Ok. So I've been stuck on this for a while now, and just to get past it, I added the last two lines, which should literally make it impossible for is_prime(9) to return True. Yet would you look at the error that I get: Oops, try again. Your function fails on is_prime(9). It returns True when it should return False.
Unless I'm incredibly stupid and missing something really obvious, this code should return False for is_prime(9). Please help.
def is_prime(n): for i in range(2, n): if n % i == 0: return False else: return True if n == 0 or n == 1: return False elif n == 2: return True elif n == 9: return False