+ 2
What happens if you attempt to access an element of a list using a negative index?
3 Antworten
+ 7
HonFu yes you're right.
Pradeep Kumar
List indexes of -x means the xth item from the end of the list, so for example n[-1] means the last item in the list n.
Next time don't forget to include the Programming language in the tag.
+ 5
You read from the back of the list if it's Python - or you go where you shouldn't go if it's C.
+ 5
HonFu Also with ruby you will go backward 😄