BetaUnder construction. Questions are being reviewed by teachers — enjoy the free practice in the meantime.
Python basics · Exercise
Is it prime?
Write a function is_prime(n) that returns True if n is a prime number and False if it is not. Remember: a prime number is greater than 1 and has no divisors other than 1 and itself, so 0 and 1 are NOT prime. Hint: Try dividing n by every number from 2 up to n-1. If any division leaves no remainder, n is not prime.