Guest User

Untitled

a guest
Sep 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. while chance > 0:
  2. guess = raw_input("What goes in ___%s___: " % str(index+1))
  3. if checkanswer(answer, guess):
  4. print "Correct! n"
  5. print '-' * 20
  6. quiz = quiz.replace('___%s___' % str(index+1), guess)
  7. print quiz
  8. print '-' * 20 + 'n'
  9. break
  10. elif chance > 1:
  11. print "That is incorrect. Try again."
  12. chance += -1
  13. print chance, "chance(s) left. n"
  14. else:
  15. alive = False
  16. break
  17. return quiz
  18.  
  19. print 'n' + "* " * 10
  20. print "Welcome to the quiz.n"
  21. setdifficulty()
  22. quiz = quizes[difficulty]
  23. setchances()
  24.  
  25. print "Let's get started:"
  26. print "=" * 20
  27. print quiz
  28. print "=" * 20 + 'n'
  29.  
  30. for index in xrange(len(answers[difficulty])):
  31. quiz = answerquestion(index, quiz)
  32. if not alive: break
  33.  
  34. if alive:
  35. print "Great job completing the %s quiz!n" % difficulty
  36. else:
  37. print "Too many wrong guesses. Game over.n"
  38.  
  39. return alive
Add Comment
Please, Sign In to add comment