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:

  1. Define function rand_generator( ) that generates a random integer number between 1-200 and return it.
  2. 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.
  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!