Jun-25-2018, 03:22 AM
(This post was last modified: Jun-25-2018, 03:22 AM by ichabod801.)
Actually, you want to remove this line:
BTW, if that really is the code you copied from the tutorial you are learning from, find a new tutorial. That's really bad code. Oh, and count is the number of correct answers, so what the code actually does is let you guess until you have all the letters. You can't lose.
guess = guess.upper()This upper cases the letter you guessed, so if you guessed 'a', it becomes 'A'. But if you look at possibleAnswers at the beginning of the code, it's all in lower case. So you're constantly trying to match upper case characters to lower case. It would actually make more sense to replace that line with:
guess = guess.lower()That way, even if you guess 'A', it will match against 'a', which is what might be in the answer.
BTW, if that really is the code you copied from the tutorial you are learning from, find a new tutorial. That's really bad code. Oh, and count is the number of correct answers, so what the code actually does is let you guess until you have all the letters. You can't lose.
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