slicing_lvl_2.md

April 23, 2022 ยท View on GitHub

Slicing - Level 2

What is the result of each of the following statements if x = 'abcdefgh'

  1. x[-1:-2]
  2. x[3:-1]
  3. x[::1]
  4. x[::3]
  5. x[1:2:3]
  6. x[::-1]
  7. x[1::-1]

Solution

Click here to view the solution.