Learn python (4/16) Acces by Index


#1

So, i have an understanding problem with an exercise.
here’s a picture of it : http://puu.sh/AfrCR/6db3b08324.png
i thought that Python starts counting at 0, so the 5th letter in MONTY would be nothing but the solution says its “Y” is it because theres no other letter left?

Thx for all help


#2

The addressing scheme of strings and lists does nothing to change the fact that y is the fifth letter of monty


#3

Yep. Sometimes i’m to stupid for the simplest things :smile:
Thx anyways


#4

We learn to point as we count and say one for the first one, and so on.

Indexes are locations.
Zero is the base case where nothing has yet been done/added/whatever
Zero also has to go somewhere, unless you’re willing to skip from 1 to -1 when going backwards


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.