What does `'algorithm'[3:4]` return in Python?

Answer and explanation

Correct answer: D. `'o'`

  1. Step 1: Slicing includes the start index and excludes the end index.
  2. Step 2: Characters 3 to 3 are 'o'.
Answer
`'o'`.
Why not the others: `''`, `'r'` and `'i'` do not fit.

Practise more Python programming and algorithms.

Free questions with an explanation for every one, and full timed Saudi Secondary School Certificate mock tests.