Skip to main contentSkip to solution

When positional indices are used for __________, the value at end index position is excluded.

Solution

✅ Correct Option: 2

In slicing, the syntax is seq[start:end]. It returns elements from the start index up to, but not including, the end index. For example, if s = "PYTHON", then s[1:4] gives YTH, and the element at index 4 is left out.


Option 1: indexing picks a single element at the given position, so nothing is excluded. For example, s[4] gives O.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question