Search Bar

Check whether the given number is Prime or NOT in Python?

 How to check Prime Number in Python.


Hi guys,

            Today we are going to see a python base solution for Finding whether the given number is a PRIME number or NOT a PRIME number. so let's get started.

Check a prime number

What is a prime number?
A number that is completely divisible by itself and 1. (Note: 1 is not a prime number.) Example 2, 3, 5, 7, 11, 13 ..... and so on





In our program, we take one number and store in the 'num' variable. then we take one for loop ranges from given number to 'num-1'. if(num%i==0): then the given number is NOT A PRIME number. When this true then break a loop. else it is a PRIME NUMBER.
Refer to a given code for your reference.

Post a Comment

0 Comments