Question: Code writing problems: 37. Assume a function isprime () is available for you to use in a module called ENGR102 which determines whether or not
Code writing problems: 37. Assume a function isprime () is available for you to use in a module called ENGR102 which determines whether or not a number is a prime number. The function isprime () takes in as a parameter a single integer, and returns either True or False. Write a Python program that takes as input from the user two integers. If the user gives bad input, continue to prompt them to try again until they enter two integers. Then, test only the odd numbers between and including those two numbers, to check if they are prime using the isprime () function. Have your program print a list of the prime numbers found. If no prime numbers were found, have your program print a message stating that. Start your code with: from ENGR102 import isprime. You do not have to write the function i. spr ime (), you only need to call it. Example output (bad input): Enteraninteger:0.5Enteranotherinteger:1Enteraninteger:8Enteranotherinteger:10 Example output (good input): Bad input! Try again first integer: 1 No primes found! Try again second integer: 5 Primes: [2,3,5]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
