You are on page 1of 6

score = 0

print ("welcome to the quiz")

username = input("enter your username:")


age = int(input("enter your age:"))

print ("in this quiz",username, "will be asked to finish a challenge out of 3 challenges")
print ("the number for math room is 1, general knowledge is 2, and sports/music is 3")
print ("you will be asked to enter the number of the challenge you want to do")
room = int(input("enter the number of the challenge you want to do:"))
if room == 1:
print ("Welcome to the math room")
print ("you will be asked to answer 3 math questions")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 20 point")
print ("if you get the question wrong you will get minus 5 points")
answer=int(input("345+234="))

if answer == 579:
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
answer=int(input("896-257="))
if answer == 639:
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
answer=int(input("546+234="))
if answer == 780:
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
print ("your score is", score)
elif room == 2:
print ("Welcome to the general knowledge room")
print ("you will be asked 3 questions about general knowledge")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 20 point")
print ("if you get the question wrong you will get minus 5 points")
answer=input("what is the capital city of the USA?=")
if answer == "washington":
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
answer=input("what is the capital city of the UK?=")
if answer == "london":
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
answer=input("what is the capital city of france?=")
if answer == "paris":
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
print ("your score is", score)
elif room == 3:
print ("Welcome to the Sports/Music room")
print ("you will be asked to answer 3 questions about sports/music")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 20 point")
print ("if you get the question wrong you will get minus 5 points")
answer=input("who is the best football player in the world?")
if answer == "messi":
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
answer=input("who is the best basketball player in the world?")
if answer == "lebron james":
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
answer=input("who is the best tennis player in the world?")
if answer == "novak djokovic":
print ("correct")
score = score + 20
else:
print ("incorrect")
score = score - 5
print ("your score is", score)
Update
score = 0
print ("welcome to the quiz")

username = input("enter your username:")


age = int(input("enter your age:"))

while True:
print ("in this quiz",username, "will be asked to finish a challenge out of 3
challenges")
print ("the number for math room is 1, general knowledge is 2, and
sports/music is 3")
print ("you will be asked to enter the number of the challenge you want to
do")
print ("press q to exit the game or choose rooms to continue")
room = input("enter the number of the challenge you want to do:")
if room == '1':
print ("Welcome to the math room")
print ("you will be asked to answer 3 math questions")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 20 point")
print ("if you get the question wrong you will get minus 5 points")
answer=int(input("345+234="))

if answer == 579:
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is 579")
score = score - 5
answer=int(input("896-257="))
if answer == 639:
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is 639")
score = score - 5
answer=int(input("546+234="))
if answer == 780:
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is 780")
score = score - 5
print ("your score is", score)
elif room == '2':
print ("Welcome to the general knowledge room")
print ("you will be asked 3 questions about general knowledge")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 20 point")
print ("if you get the question wrong you will get minus 5 points")
answer=input("what is the capital city of the USA?=")
if answer == "washington" or answer == "Washington":
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is washington")
score = score - 5
answer=input("what is the capital city of the UK?=")
if answer == "london" or answer == "London":
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is london")
score = score - 5
answer=input("what is the capital city of france?=")
if answer == "paris" or answer == "Paris":
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is paris")
score = score - 5
print ("your score is", score)
elif room == '3':
print ("Welcome to the Sports/Music room")
print ("you will be asked to answer 3 questions about sports/music")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 20 point")
print ("if you get the question wrong you will get minus 5 points")
answer=input("who is the best football player in the world?")
if answer == "messi" or answer == "Messi" or answer == "lionel messi" or
answer == "Lionel Messi":
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is messi")
score = score - 5
answer=input("who is the best basketball player in the world?")
if answer == "lebron james" or answer == "Lebron James" or answer ==
"LeBron James" or answer == "LeBron james" or answer == "lebron James" or
answer == "Lebron james" or answer == "leBron james" or answer == "LeBron
James" or answer == "LeBron james" or answer == "lebron james":
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is lebron james")
score = score - 5
answer=input("who is the best tennis player in the world?")
if answer == "novak djokovic" or answer == "Novak Djokovic" or answer
== "Novak djokovic" or answer == "novak Djokovic" or answer == "novak
djokovic" or answer == "Novak Djokovic" or answer == "Novak djokovic" or
answer == "novak Djokovic" or answer == "novak djokovic" or answer ==
"Novak Djokovic" or answer == "Novak djokovic" or answer == "novak
Djokovic" or answer == "novak djokovic" or answer == "Novak Djokovic" or
answer == "Novak djokovic" or answer == "novak Djokovic" or answer ==
"novak djokovic" or answer == "Novak Djokovic" or answer == "Novak
djokovic" or answer == "novak Djokovic" or answer == "novak djokovic" or
answer == "Novak Djokovic" or answer == "Novak djokovic" or answer ==
"novak Djokovic" or answer == "novak djokovic" or answer == "Novak
Djokovic" or answer == "Novak djokovic" or answer == "novak Djokovic" or
answer == "novak djokovic":
print ("correct")
score = score + 20
else:
print ("incorrect, the correct answer is novak djokovic")
score = score - 5
print ("your score is", score)
elif room == "q":
print("thank you for playing")
break
if score <= 20:
print ("you failed the quiz, do you want to answer the extra questions to
get extra points?")
answer=input("yes or no?")
if answer == "yes":
print ("you will be asked 2 questions")
print ("you will be given 3 seconds to answer each question")
print ("if you get the question right you will get 40 point")
print ("if you get the question wrong you will get minus 20 points")
answer=input("who is the best singer in the world?")
if answer == "justin bieber" or answer == "Justin Bieber" or answer
== "Justin bieber" or answer == "justin Bieber" or answer == "justin bieber" or
answer == "Justin Bieber" or answer == "Justin bieber" or answer == "justin
Bieber" or answer == "justin bieber" or answer == "Justin Bieber" or answer
== "Justin bieber" or answer == "justin Bieber" or answer == "justin bieber" or
answer == "Justin Bieber" or answer == "Justin bieber" or answer == "justin
Bieber" or answer == "justin bieber" or answer == "Justin Bieber" or answer
== "Justin bieber" or answer == "justin Bieber" or answer == "justin bieber" or
answer == "Justin Bieber" or answer == "Justin bieber" or answer == "justin
Bieber" or answer == "justin bieber":
print ("correct")
score = score + 40
else:
print ("incorrect, the correct answer is justin bieber")
score = score - 20
answer=input("who is the best rapper in the world?")
if answer == "eminem" or answer == "Eminem":
print ("correct")
score = score + 40
else:
print ("incorrect, the correct answer is eminem")
score = score - 20
print ("your score is", score)
else:
print ("thank you for playing")
print ("your score is", score)

You might also like