User8574
Active Coder
This quiz project doesn't work.
For some reason, line 63 (if total_score == >3 and >5) is shown as an error. Anyone know why? I think it is because of the less than and more than signs but I'm not sure how to fix it
Python:
print("History Quiz")
total_score = 0
print()
question1 = input("For how many years did WW2 last? - 3, 5, 6 or 8? ")
if int(question1) == 6:
print("Correct!")
else:
print("Better luck next time!")
print()
question2 = input("In what year did Harry Truman take power in the United States? - 1944, 1945, 1946, or 1948? ")
if int(question2) == 1945:
print("Amazing!")
else:
print("Incorrect! :/")
print()
question3 = input("In what year did the Soviet Union collapse? - 1990, 1993, 1989, or 1991 ")
if int(question3) == 1991:
print("Absoloutely! :)")
else:
print("Try again next time!")
print()
question4 = input("What did American prohibition restrict? - a = Alchohol, b = Drugs, c = Milk, or d = Meat ")
if question4.upper() == "A":
print("Of course!")
else:
print("I expected better!")
print()
question5 = input("in what year did Uganda gain independence? 1960, 1961, 2010, or 1936 ")
if int(question5) == 1961:
print("Well Done!")
else:
print("No!")
print()
if int(question1) == 6:
total_score = total_score + 1
if int(question2) == 1945:
total_score = total_score + 1
if int(question3) == 1991:
total_score = total_score + 1
if question4.upper() == "A":
total_score = total_score + 1
if int(question5) == 1961:
total_score = total_score + 1
print("Your total score is:", total_score,"out of 5")
if total_score == >3 and >5:
print("Good score!")
elif total_score == <4 and >1:
print("Try harder next time!")
elif total_score == <2:
print("You don't know anything. Read more books!")
else:
print("You are a genius! Read less books!")
For some reason, line 63 (if total_score == >3 and >5) is shown as an error. Anyone know why? I think it is because of the less than and more than signs but I'm not sure how to fix it