Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The input () function allows you to accept typed input from a user as a string. For example, X = input (Please input a
The input () function allows you to accept typed input from a user as a string. For example, X = input ("Please input a number. ") # user types 7 X # output '7' Write code that prompts a user to input an odd int. If the user inputs an even int, the code should re-prompt them for an odd integer. After the user has entered an odd integer, the code should print a list of all numbers that the user input. The code int("1") will convert strings composed of numerals into integers. You may assume that the user will only input such strings. Hint: Try while and associated tools. Example #your code > Please enter an integer. 6 > Please enter an integer. 8 > Please enter an integer. 4 > Please enter an integer. 9 > [6, 8, 4, 9]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Python numbers while True userinput inputPlease enter an integer try number intuserinput if ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started