Question: Write a Python program in which the user enters either ' A ' , ' a ' , ' B ' , ' b '

Write a Python program in which the user enters either 'A','a','B','b','C' or 'c'. If 'A' or 'a' is entered,
the program should display the word 'Apple'; if 'B' or 'b' is entered, it displays 'Banana'; and if 'C' or
'c' is entered, it displays 'Coconut'. Use nested if statements for this as depicted in Figure 1 or in
slides. The first line should print out a title that says something like Problem E: Practice using
Nested If statements. If the user enters an invalid input, the program should print INVALID
INPUT.
Hint: You may want to use the upper or lower function
Example1(shell):
------Problem E: Practice using Nested If statements------
Enter 'A' for apple, 'B' for banana, and 'C' for coconut: a
Apple

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!