Question: PYTHON Q#6 Write a program that contains following functions: Define function rand_generator( ) that generates a random integer number between 1-200 and return it. Define
PYTHON
Q#6 Write a program that contains following functions:
- Define function rand_generator( ) that generates a random integer number between 1-200 and return it.
- Define function check_odd( ) that gets a number as an input parameter and return True if the input parameter is an odd number and return False otherwise.
- Define a function main( ) that first asks the user how many random numbers should be generated and then uses the above two functions to generate and then count the total number of odd numbers and even numbers in the set of randomly generated numbers and display them to user.
Here is an example:
input: Please specify how many random number should be generated: 50
output: There are 23 odd numbers in 50 randomly generated numbers. There are 27 even numbers in 50 randomly generated numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
