Help on Strings


#1



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!

https://www.codecademy.com/courses/python-beginner-sRXwR/0/4?curriculum_id=4f89dab3d788890003000096

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.


#2

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


#4

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


#5

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