0

Can you explain me this?

str = "data structure" print(str[-11:-3:3]) # Output: 'atc'

24th Nov 2021, 2:49 PM
Amisha
Amisha - avatar
1 Answer
+ 8
-11 is the 11th character from the back, -3 is the 3rd character from the back. 3 is the step-size. Compare to the range() function
24th Nov 2021, 2:57 PM
Lisa
Lisa - avatar