+ 1
What does [1:] and [0:1] mean?
https://code.sololearn.com/ccJ13qgHF9P8/?ref=app x="" for i in input().split(): x += i[1:] + i[0:1] + "ay " print (x)
2 Answers
+ 5
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_lists_access.asp
Someone else can explain better than me.
But what I remember,
[1:] returns everything from index 1 and beyond
And [0:1]
Returns anything from the starting index up but not including the ending index.
Since you have [0:1], the program will only return index 0.
+ 1
Thanks