# Python Program to Check Prime Number

Write a Python program to check if a given number is a prime number or not.

A prime number is a number that is fully divisible by itself or 1 only. Such as 13 is a prime number, it is not fully divisible by any of the number between 2-12.

Similarily 3, 7, and 11 etc are the prime numbers

## Example:

Here is a sample Python program:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Python program to check if given number is prime number or not num = 13 # Uncomment below to take user input # num = int(input("Enter a number: ")) # prime numbers are greater than 1 if num > 1: for i in range(2,num): if (num % i) == 0: print(num, "is not a prime number") break else: print(num, "is a prime number") else: print(num, "is not a prime number") |

Execute above script and you will see the result like:

13 is a prime number