Question: How can I write a code for the question in simple python language [10 marks] Write a function named get_choice that takes no parameters. This

How can I write a code for the question in simple python language How can I write a code for the question in simple python

[10 marks] Write a function named get_choice that takes no parameters. This function asks the user to enter a number between 1 and 5 . It must perform error checking to accept only integers between 1 and 5 (inclusive). When an allowed number is entered, it returns that number. The following example shows the expected wording and formatting: 1>>> [evaluate Lab1_JC.py] 2>>> get_choice() Select option (1 to 5): a Invalid option. Please enter a number between 1 and 5: a Invalid option. Please enter a number between 1 and 5: ? Invalid option. Please enter a number between 1 and 5: Invalid option. Please enter a number between 1 and 5: 3.4 Invalid option. Please enter a number between 1 and 5: 0 Invalid option. Please enter a number between 1 and 5: 6 Invalid option. Please enter a number between 1 and 5: 2 2

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