Question: Submit a single python file with a . py file extension, that includes all of your programs. When the code is ran, the programs should
Submit a single python file with a py file extension, that includes all of your programs. When the code is ran, the programs should execute one after the next, in Python, without stopping. Your program must include functions.
Program : Even or Odd
The intent of this program is to allow a user to enter integer inputs, and after each input it immediately outputs a formatted statement as to whether the input is even of odd. The user will continue to be prompted to enter an integer until the sentinel value is entered at which point the program will stop. The user must be notified of the sentinel value. The functionality must be accomplished using a while loop, and the program must include at least functions:
An appropriately named function that runs the program something like evenOd including a finished statement.
a program header as described in homework #
a function that gets the user input and then returns that value for use with your while loop
a function that is passed the number, and then outputs the formatted statement of whether that
number is even or odd
You will need to select a sentinel
For this program the users input should be passed to:
o the function where it is used in the while loop
o the output function to print out the odd or even statement
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
