Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while chance > 0:
- guess = raw_input("What goes in ___%s___: " % str(index+1))
- if checkanswer(answer, guess):
- print "Correct! n"
- print '-' * 20
- quiz = quiz.replace('___%s___' % str(index+1), guess)
- print quiz
- print '-' * 20 + 'n'
- break
- elif chance > 1:
- print "That is incorrect. Try again."
- chance += -1
- print chance, "chance(s) left. n"
- else:
- alive = False
- break
- return quiz
- print 'n' + "* " * 10
- print "Welcome to the quiz.n"
- setdifficulty()
- quiz = quizes[difficulty]
- setchances()
- print "Let's get started:"
- print "=" * 20
- print quiz
- print "=" * 20 + 'n'
- for index in xrange(len(answers[difficulty])):
- quiz = answerquestion(index, quiz)
- if not alive: break
- if alive:
- print "Great job completing the %s quiz!n" % difficulty
- else:
- print "Too many wrong guesses. Game over.n"
- return alive
Add Comment
Please, Sign In to add comment