Strings & Console Output MONTY


#1



https://www.codecademy.com/courses/python-beginner-sRXwR/0/4?curriculum_id=4f89dab3d788890003000096#


If you start with 0 and are counting five digits, wouldn't "Monty" not have enough letters (ending at 4)? What am I missing here?



#2
M O N T Y
0 1 2 3 4   <= index

#3

ah, so I was counting the z-index instead of the original letters, exactly what it said not to do. Thank you.


#4

Way back when I found that thinking in terms of offset, as opposed to index gives the index a unit measure.

M  => offset from left = 0 units
O  => offset = 1 unit
N  => offset = 2 units
T  => offset = 3 units
Y  => offset = 4 units

#5

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