I have this piece of code that is meant to ask you what the blank word should be and then moves on to the next one if you correctly guess. That part is working fine, but if you enter the wrong answer it should ask the question again but is not doing that. Instead the python shell just sits there blank, no error, nothing. I can't see the problem:
while victory == False:
if askq == answerx[counter]:
newstring = newstring.replace(blank_list[counter],answerx[counter])
counter += 1
print newstring
if counter < len(blank_list):
askq = raw_input('What word is ' + blank_list[counter] + '? ')
if newstring == answers:
print 'Congratulations!'
victory = True
Aucun commentaire:
Enregistrer un commentaire