Advertisement
gonzalesc

ezquiz

Oct 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. print("lets test your knowledge about python")
  2. print("are you ready to play")
  3. user_name = input("what is your name ?")
  4. user_score = 0
  5. question1 = input("what do you type if you want the program to display something to the user?")
  6. question2 = input("what do you type after your if,elif, or else statement so the program knows you are evaluating something?")
  7. question3 = input("how many spaces is an indent in python?")
  8. if question1 == "print" or question1 == "Print":
  9.     print("YES! That is correct.")
  10.     user_score = user_score + 1
  11. else:
  12.     print("Sorry - the correct answer is print")
  13.    
  14. if question2 == ":":
  15.     print("YES! That is correct.")
  16.     user_score = user_score + 1
  17.  
  18. if question3 == "2" or question3 == "4":
  19.     print("Yes! That is correct.")
  20.     user_score = user_score + 1
  21. final_score = str(user_score)
  22. print(user_name + " you got " + final_score + " answers correct!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement