Aug-17-2018, 11:11 PM
Python is 0-indexed. Therefore the maximum index of a string is the length of the string minus one. Your loop goes all the way to length, thus going out of range. This is one reason to avoid looping over indexes. Loop directly over the string:
for letter in nom: if letter == char: ...Also, you should use more descriptive variable names. It makes your code easier to read and understand, like to the people you want help from.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures