Continental Interview Question

python code for prime number