fb pixel

Prime checking

A number is considered prime if it’s only divisible by itself and by 1 (exactly two numbers).
Implement a function is_prime(n) that would return True if n is prime and False otherwise.
The input contains a single integer n (1 ≤ n ≤ ).
The program should print Yes if n is prime and No otherwise.
Input
Output
7
Yes
1
No
8
No
5
Yes
 
To check your solution you need to sign in
Sign in to continue