Help on Strings


Please help me! I'm brand new to programming and I've been stuck on this problem (Python, Access by Index) for a half hour!

What do they mean by the fifth letter, since when I type in "MONTY" so that my code looks like: fifth_letter = "MONTY" I get an error message, saying that the fifth letter is not "MONTY". What's going on? Thanks!

Replace this line with your code.


in python string is like table , columns are the caractère ( lettre) , so if wee wanna display the fifth lettre our code will be "MONTY"[4] , remark that we begin number of columns by 0 not 1


This concept is similar to array.
If you want to print any specific character from a string then use index of that particular character.
Use as follows:
fifth_letter = "MONTY"[4]
print fifth_letter


Remember, you start counting from zero so it would be fifth_letter = 4