Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
[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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions