Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 743 Bytes

slicing_reversing.md

File metadata and controls

53 lines (39 loc) · 743 Bytes

Slicing and Reversing

Pictures help when trying to understand slicing, especially when using negative indexes along with positive indexes.

String sample


1. str[:0:-1]


2. str[:3:-1]


3. str[:2:-1]


4. str[-2:-6:-1]


5. str[-4:-1:-1]


6. str[-4:1:-1]


7. str[-3:1:-1]


8. str[-4:-1:]


9. str[-4:2:]


10. str[-2:-1:]


11. str[::-1]