What am I doing wrong?


#1


#2

Hi @toufeeks,

Use the string "MONTY" in your code, and use an index to access the fifth letter in that string.

The examples that are provided in the instructions can serve as a model for how to use an index with a string.


#3

fifth_letter = MONTY[5]

print fifth_letter


#4

fifth_letter = MONTY[4]

print fifth_letter

sorry. its 4 not 5. it starts counting from 0.


#5

Hi @toufeeks,

The string "MONTY" has five characters,
numbered 0 to 4, as shown below:

+---+---+---+---+---+
| M | O | N | T | Y |
+---+---+---+---+---+
  0   1   2   3   4

Now, use the appropriate index to assign the variable fifth_letter equal to the fifth letter of the string "MONTY".


#6

Thanks that one worked :smiley:


#7