SHARE
TWEET

Untitled

a guest Oct 20th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. question = "Select right answer: 100 * 100 = ?"
  2. answer1 = "1000"
  3. answer2 = "222"
  4. answer3 = "10000"
  5. answer4 = "100000"
  6. rightAnswer = "3"
  7.  
  8. print(question)
  9. print("1: " + answer1)
  10. print("2: " + answer2)
  11. print("3: " + answer3)
  12. print("4: " + answer4)
  13.  
  14. for i in range(10):
  15.     userAnswer = input("Your answer: ")
  16.  
  17.  
  18.    
  19.  
  20.     userAnswer = input("Your answer: ")
  21.  
  22.     try:
  23.         userAnswer = int(userAnswer)
  24.     except Exception:
  25.         userAnswer = 0
  26.     if rightAnswer == userAnswer:
  27.         print("Yes")
  28.     elif userAnswer > 0 & userAnswer <=4:
  29.      print("No, you selected wrong answer")
  30.     elif userAnswer == 0:
  31.        ("You entred not number!")
  32.     else:
  33.         print("Please, select answer fron the list")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top