(python) Write a function myfunction that requests user input i the form of an integer value, 1, 2 or 3.  The function should print out: Option 1 selected Option 2 selected Option 3 selected when the corresponding number is entered, and the loop should end if q is entered.  Any unrecognised options should result in the following statement being printed: Unknown option

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 2PP
icon
Related questions
Question

(python)

Write a function myfunction that requests user input i the form of an integer value, 1, 2 or 3.  The function should print out:

  1. Option 1 selected
  2. Option 2 selected
  3. Option 3 selected

when the corresponding number is entered, and the loop should end if q is entered.  Any unrecognised options should result in the following statement being printed:

  • Unknown option
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Function
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr