Question: 5. Displays a rank in the defined dictionary. a) Create a dictionary, rank {1:Freshman, 2.Sophmore, >:junior, 4:Senior} b) Request a user input for a number

5. Displays a rank in the defined dictionary. a)
5. Displays a rank in the defined dictionary. a) Create a dictionary, rank {1:"Freshman", 2."Sophmore", >:"junior", 4:"Senior"} b) Request a user input for a number of years. c) Print the value of the matching key in the dictionary. d) Print the error message if input is invalid. Example Output 1 Enter the # of years in the school (1-4): 1 Year 1 - Freshman Example Output _ Enter the II of years in the school (1-4): 11 Invalid yours

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 Mathematics Questions!