In: Computer Science
PYTHON CODE::
a = input("Are you ready for quiz?")
if a == 'Y' or a == 'y':
score = 0
print("\nOkay, here are all questions!")
print("\nQ1) Which is the biggest animal?\n1) Tiger\n2) Rat\n3)
Elephant\n>",end="")
ans = int(input())
if ans == 3:
print("That's right!")
score += 1
else:
print("Sorry, Elephant is the correct answer.")
print("Q2) What is the result of 9+6/3?\n1) 5\n2) 11\n3)
15/3\n>",end="")
ans = int(input())
if ans == 2:
print("That's correct!")
score += 1
else:
print("Sorry, here 11 is the correct answer!")
print("Q3) Can you store the value “hello” in a variable of type
double?\n1) Yes\n2) No\n>",end = "")
ans = int(input())
if ans == 2:
print("That's correct!")
score += 1
else:
print("Sorry, “hello” is a string. Double can only store floating
point numbers.")
print("Overall, you got",score,"out of 3 correct.")
print("Thanks for playing !")
else:
print("Please try the quiz again")
SCREENSHOTS::