View Single Post
Old May 11th, 2006, 5:12 PM   #8
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
In your while loop, you're using "or" when you should be using "and".

The while loop runs whilst the condition it's initiated with is true. The first element of your condition is "newword!=orgword". This will become false when the user wins at hangman. The second condition is "life!=0". This will become false when the user loses at hangman.

With the "or" operator, the while condition will remain true so long as one of the conditions is true. You want the loop to end if any one of the conditions becomes false, so you want an "and":

while newword!=orgword and life!=0:
Arevos is offline   Reply With Quote