question: ART AND LITERATURE: Who painted "The Birth of Venus"? a. Botticelli b. Michelangelo c. Leonardo da Vinci Enter your choice:d Invalid input! Enter a, b, or c next time. as a

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
I don’t know how to change my code to answer the question and make it just like the output
You notice that users are entering upper case letters, complete responses, and other hard to deal with input. To
help them out, you will extend your program so that if the user enters something other than 'a', 'b', or 'c' the
program will immediately respond with
Invalid input! Enter a, b, or c next time.
Your program will go on to mark them incorrect.
This behavior will apply to the multiple choice questions only. Below is how your output should look for the first
question:
ART AND LITERATURE: Who painted "The Birth of Venus"?
a. Botticelli
b. Michelangelo
c. Leonardo da Vinci
Enter your choice:d
Invalid input! Enter a, b, or c next time.
The correct answer was a
Transcribed Image Text:You notice that users are entering upper case letters, complete responses, and other hard to deal with input. To help them out, you will extend your program so that if the user enters something other than 'a', 'b', or 'c' the program will immediately respond with Invalid input! Enter a, b, or c next time. Your program will go on to mark them incorrect. This behavior will apply to the multiple choice questions only. Below is how your output should look for the first question: ART AND LITERATURE: Who painted "The Birth of Venus"? a. Botticelli b. Michelangelo c. Leonardo da Vinci Enter your choice:d Invalid input! Enter a, b, or c next time. The correct answer was a
#01:
print('ART AND LITERATURE: Who painted "The Birth of Venus"?')
print('a. Botticelli\nb. Michelangelo\nc. Leonardo da Vinci')
user_answer=input("Enter your choice:")
if user_answer=='a':
print("Correct!")
score+=1
else:
#02:
print('ENTERTAINMENT: How many oscars did Alfred Hitchcock win?')
print('a. None\nb. One\nc. Two')
user_answer=input("Enter your choice:")
if user_answer=='a':
print("Correct!")
#03:
print("The correct answer was a"):
score+=1
elif user_answer!='a' or user_answer!= 'b' or user_answer!='c':
print("Invalid input! Enter a, b, or c next time.")
else:
print("The correct answer was a")
print('GEOGRAPHY: Which is the largest ocean?')
print('a. Pacific\nb. Atlantic\nc. Indian')
user_answer=input("Enter your choice: ")
if user_answer== 'a':
print("Correct!")
# 04:
score+=1
elif user_answer!='a' or user_answer!='b' or user_answer!='c':
print("Invalid input! Enter a, b, or c next time.")
else:
print("The correct answer was a")
print('HISTORY: Who was the first U.S. president to appear on a coin?')
print('a. Washington\nb. Lincoln\nc. Jefferson')
user_answer=input("Enter your choice:")
if user_answer== 'b':
print("Correct!")
elif user_answer!= 'a' or user_answer!='b' or user_answer!='c':
print("Invalid input! Enter a, b, or c next time.")
else:
print("The correct answer was b")
#05:
score+=1
print('SCIENCE AND NATURE: Can pigs swim?')
print('a. Yes\nb. No\nc. Only in salt water')
user_answer=input("Enter your choice:")
if user_answer=='a':
print("Correct!")
#06
score+=1
elif user_answer!='a' or user_answer!='b' or user_answer!='c':
print("Invalid input! Enter a, b, or c next time.")
else:
print("The correct answer was a")
nrint('SPORT AND LETSURE: What color is the middle Olymnic ring?!)
MacE
Transcribed Image Text:#01: print('ART AND LITERATURE: Who painted "The Birth of Venus"?') print('a. Botticelli\nb. Michelangelo\nc. Leonardo da Vinci') user_answer=input("Enter your choice:") if user_answer=='a': print("Correct!") score+=1 else: #02: print('ENTERTAINMENT: How many oscars did Alfred Hitchcock win?') print('a. None\nb. One\nc. Two') user_answer=input("Enter your choice:") if user_answer=='a': print("Correct!") #03: print("The correct answer was a"): score+=1 elif user_answer!='a' or user_answer!= 'b' or user_answer!='c': print("Invalid input! Enter a, b, or c next time.") else: print("The correct answer was a") print('GEOGRAPHY: Which is the largest ocean?') print('a. Pacific\nb. Atlantic\nc. Indian') user_answer=input("Enter your choice: ") if user_answer== 'a': print("Correct!") # 04: score+=1 elif user_answer!='a' or user_answer!='b' or user_answer!='c': print("Invalid input! Enter a, b, or c next time.") else: print("The correct answer was a") print('HISTORY: Who was the first U.S. president to appear on a coin?') print('a. Washington\nb. Lincoln\nc. Jefferson') user_answer=input("Enter your choice:") if user_answer== 'b': print("Correct!") elif user_answer!= 'a' or user_answer!='b' or user_answer!='c': print("Invalid input! Enter a, b, or c next time.") else: print("The correct answer was b") #05: score+=1 print('SCIENCE AND NATURE: Can pigs swim?') print('a. Yes\nb. No\nc. Only in salt water') user_answer=input("Enter your choice:") if user_answer=='a': print("Correct!") #06 score+=1 elif user_answer!='a' or user_answer!='b' or user_answer!='c': print("Invalid input! Enter a, b, or c next time.") else: print("The correct answer was a") nrint('SPORT AND LETSURE: What color is the middle Olymnic ring?!) MacE
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

is there another way to do it without using ins.islower?

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education