Check if a number is prime
Created on Jan. 16, 2017 by Julien Palard
Define the function is_prime(n)
.
n
is number that the function is_prime
takes as a parameter.
The function is_prime
return True
if n
is a prime number, False
otherwise. Such as:
Examples
1 2 3 4 5 6 7 8 9 |
|
There's no corrections yet, hit the `Submit` button to send your code to the correction bot.
Keyboard shortcuts:
- Ctrl-Enter: Send your code to the correction bot.
- Escape: Get back to the instructions tab.