A prime-checking function
Write code · Medium · §8.6 The math helper as parts
Complete the function is_prime(n), which returns True if n is prime and False if it is not. Numbers of 1 or less are not prime. Grading calls the function with several numbers.
Starter code
def is_prime(n):
# Write your code here
pass
print(is_prime(7))
print(is_prime(9))Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.