0
String
Let s be an string then what s[5:] and s[:5] means?
4 Answers
+ 1
s[5:] is similar to s[5:len(s)]
Basically it prints values from index 5 till the end of the list or string.
s[:5] is similar to s[0:5]
It prints values from index 0 till 4. Index 5 is excluded.
+ 1
Yes when you start from the end, the last element is at index -1.