while loops within while loops | SoloLearn: Learn to code for FREE!

+2

while loops within while loops

im writing my own hangman game and im having issues with this part while x != 6: hang = input("choose a letter : ") print("") while (len(hang)) > 1: print("one letter at a time hero") hang = input("choose a letter : ") while hang in used: hang = input("letter already used try again : ") print("") while (len(hang)) == 0: hang = input("you must guess a letter hero : ") print("") while hang.isdigit(): hang = input("your guessing words not numbers hero guess a letter : ") the issue is that if one of these catches an error it will work however if it say you enter a number and then enter two letters the double letters will go through how can i change the code to fix this

12/12/2017 4:42:02 AM

David Aseltine

3 Answers

New Answer

+1

I'll try the if / elif statements and see if that works and post the results

+1

the if elif statements worked thank you