Question: Write a function named is _ prime. It takes a positive integer as a parameter. The function checks if the positive given number ( greater

Write a function named is_prime. It takes a positive integer as a parameter. The function checks if
the positive given number (greater than zero) is a prime number. The function returns a boolean that is
true if the number is prime.
Use the Python shell to test is_prime.
Examples:
is_prime(1) should return False
is_prime(7) should return True
is_prime(8) should return False

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!