a) Write a program to quiz the user on a topic of your choosing. Here are the cr
ID: 3835878 • Letter: A
Question
a) Write a program to quiz the user on a topic of your choosing. Here are the criteria: Your program "L3Q1 initials.py" must start with a commented ID Box AND include a comment that indicates the purpose of the program. Your program should: (a) Display a title reflective of your quiz topic (b) For each of your mandatory FOUR questions: a. Display the qucstion b. Prompt the user for an answer and allow them to type it in. Ensure your program is not case sensitive. c. Indicate whether the answer is correct or not. (See sample output) (c) Once all the questions have been answered, output the number of questions that the user answered correctly. The sample output provided shows you one example run based on the solar system (with four questions). Your output should be similar but reflect your own quiz topic and the user input answers. Solar system quiz 1. How many planets are there in our solar system? Enter a number (not text) 8 Correct 2. What is the name of our galaxy? MILKY way Correct! 3. Which planet has rings that are visible from Earth? JuPITer Incorrect 4. Which is the hottest planet in our Solar System? VeNus Correct! Well done You got 3 answers correctExplanation / Answer
A python program to quiz the user on a topic of your choosing:-
print(" *** Solar System Quiz *** ")
count = 0
print(" 1. How many planets are there in our solar system? ")
answer = input()
if answer == 8:
print(" Correct! ")
count = count + 1
else:
print(" Incorrect ")
print(" 2. What is the name of our galaxy? ")
answer = input()
if answer == "MILK way":
print(" Correct! ")
count = count + 1
else:
print(" Incorrect ")
print(" 3.Which planet has rings that are visible from earth? ")
answer = input()
if answer == "juPITer":
print(" Correct! ")
count = count + 1
else:
print(" Incorrect ")
print(" 4. Which is the hottest planet in our Solar System? ")
answer = input()
if answer == "VeNuS":
print(" Correct! ")
count = count + 1
else:
print(" Incorrect ")
print(" Well done! You got %d answers correct. ")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.