Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

3. Identify challenges to good listening and their remedies

Answered: 1 week ago

Question

4. Identify ethical factors in the listening process

Answered: 1 week ago