Access by Index stuck?


#1

im stuck on access by index! and i dont know why.


#2

@junglywood,
Could you share the code you are using.....


#3

Code:

"""
The string "PYTHON" has six characters,
numbered 0 to 5, as shown below:

+---+---+---+---+---+---+
| P | Y | T | H | O | N |
+---+---+---+---+---+---+
0 1 2 3 4 5

So if you wanted "Y", you could just type
"PYTHON"[1] (always start counting from 0!)
"""
fifth_letter = "Y"

print fifth_letter

Instructions : On line 13, assign the variable fifth_letter equal to the fifth letter of the string "MONTY".

Remember that the fifth letter is not at index 5. Start counting your indices from zero.

?
Hint


#4

@cloclopuff: Here's a hint. Can you get "Y" without literally typing "Y"? Can you get at that letter another way? Look at the example with "PYTHON"[1].


#5

never mind, it was some kind of bug. i reloaded the page and it said i was right


#6

it kept saying that it should be "MONTY[4]" instead of "Y"


#7

my code was this :

fifth_letter = "MONTY"[4]

print fifth_letter