Hello, I still do not understand how Monty is the fifth letter when you start counting at zero?


#1

HI, my name is Beverly, nice to meet everyone.
say, Hello, I still do not understand how Monty is the fifth letter when you start counting at zero?


#2

Hi @bicababe ,

The indexes of the characters in a string and the items in a list start at 0. But we still refer to the character with an index of 0 as the first character, and the character with an index of 4 as the fifth character.


#3

Thank you, you made it very clear, I do not know why I get stuck on this, but again, thank you, thank you thank you.
Just to make sure I have it correct. The first character is an index of 0, however, a count of 1. so M is indexed at 0 but counted at 1, and since MONTY has five letters, its fifth count is Y?


#4

Hi, @bicababe,

Regardless of how we number the indexes of the characters in a string, the houses on a block, or any other type of object that occurs in a sequence, there is a first item, a second item, a third item, and so on, assuming in this current sentence that there are at least three items. If the house numbers on a block begin at 5, the house with the number 5 on its mailbox is nevertheless the first house on the block. The one with number 6, if it exists, is likely the second one on the block. There is no contradiction between a character's being the fifth one in a string, while it has an index of 4.

Character Index Ordinal Position
M 0 first
O 1 second
N 2 third
T 3 fourth
Y 4 fifth

#5

applypye you have just become the apple of my eyes, which were ready to pop out of my brain! Now this is an excellent explanation! Say, how do I get explanations as clear as this in the future?
With all seriousness, Thank you! Beverly


#6

I still don't understand what I am supposed to type... I am typing-

fifth_letter = "Y"

but it won't accept it. Please help


#7

It says, "don't forget to use the access operator [] to get the character "Y".


#8

@florencethecamel what they are looking for is understanding how to call out the letter Y from the string MONTY so for that look at the instruction So if you wanted "Y", you could just type "PYTHON"[1] so by that knowledge we can do the same for the word MONTY. by typing "MONTY"[4]


#9

but the variable monty not defines


#10

Type "MONTY"
fifth_letter="MONTY"[4]


#11