Funda swallow — the house mark in royal blueFundatryfunda.com
BetaUnder construction. Questions are being reviewed by teachers — enjoy the free practice in the meantime.

← All Computer Science

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.

Funda swallow, in gold

Excellence or Nothing

Funda ZIMSEC is in review: every question is an original draft, checked by a Zimbabwean teacher before it counts. Funda is an independent study product and is not affiliated with ZIMSEC.