Pytons


#1

Continuing the discussion from "MONTY" (all caps!):

PLEASE I REALLY NEED HELP TO PASS THIS STAGE. KEEPS SAYING "MONTY" WHICH I HAVE PUT CORRECTLY


#2

There isn't really much to say about this, as leonhard and umessi explained to @colapepsi,
the first element has index [0], so what would it be? in your case "M".

To make it easier, even though I don't see the need as leonhard explained it perfectly:
"MONTY"[0] would give you back: "M" as [0] is the FIRST element(first letter).
"MONTY"[1] would give you back: "O" as [1] is the SECOND element(second letter).
"MONTY"[2] would give you back: "N" as [2] is the THIRD element(third letter).
"MONTY"[3] would give you back: "T" as [3] is the FOURTH element(fourth letter).
"MONTY"[4] would give you back: "Y" as [4] is the FIFTH element(fifth letter).

As other ppl might have told you, indexing in python start from 0.
So in the exercise you'd do:
fifth_letter = "MONTY" [4]
print(fifth_letter)

This will print "Y".
Hope this helps, if you need any further explanation let me know!


#3

Thanks a lot. i tried and went through