Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started