Write a python program that pass number to a function


Problem 1: This program will accept three numbers (N, A, B). You need to pass these numbers to a function. This function should generate and print N random values between A and B. The function should count how many odd values and even values generated. You should return these counts to your program's main function and then display them to the user. For example, if (N=5, A=1, 8:100) and if the program generates 3, 28. 13, 79 and 80, it will print out to the user odd values = 3 and even values = 2.

Problem 2: Write a python program that will accept a positive number and pass this number to a function called "prime_function". This function takes one argument as a positive number and returns to the calling function if the number is prime or not. You need to print the return value from the main() function. Hint: a prime number is a whole number greater than 1, that has only two factors one and the number itself. A prime number is divisible only by number 1 or itself.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a python program that pass number to a function
Reference No:- TGS03260331

Expected delivery within 24 Hours