Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 226 Bytes

slicing_lvl_1.md

File metadata and controls

17 lines (13 loc) · 226 Bytes

Slicing - Level 1

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

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

Solution

  1. 'abcdefgh'
  2. 'cdefgh'
  3. ''
  4. 'c'
  5. 'h'