Assigning variable to letter


"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."

MONTY, string contains 5 letters, what will the 5th letter be if we start counting from 0, and why ?

Strings and Console Output


M is the first letter, I’m sure you can count from there


NO! M is zeroth letter …


I misunderstood the istruction, my bad


also, how to delete post? thx


First, fifth, second, third, fourth, fifth talk about how many there are after having included each item, that’s a different thing from locations

Depending on whether or not one considers 0 the first natural number, one might consider this a bug in the english language, at the same time, I’m not sure what I would suggest instead, if anything


I think it makes some sense to consider zeroth the count at which none have been included, rather than to consider zeroth the first item, so perhaps English has it right after all.

…I expect that even if asking a mathematician, one would choose the answer when choosing which one to ask


What a coincidence, i’m a mathematician… kind of. English has is right for sure : p


Lesson 1/16 & 3/16 (Escaping characters) -


“Strings need to be within quotes.” (1/16)

"This code breaks because Python thinks the apostrophe in ‘There’s’ ends the string. " (3/16)

caesar = ‘Graham’ equivalent to caesar = "Graham"
praline = ‘John’ " praline = "John"
viking = ‘Teresa’ " viking = “Teresa”

It seems I can use quotes and/or apostrophes interchangeably ? Both compiled OK on your “interpreter” without error message

Please advise

thank you


this will help you


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