Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Check if number is prime

Write a program called is_prime.py that gets a number on the command line a prints "True" if the number is a prime number or "False" if it isn't.

python is_prime.py 42
False
python is_prime.py 19
True