Python Program to check given number is Prime Number or Not
A number Greater than 1 which has only two factors. They are 1 and itself. In computer science prime number concept is very interesting and most important in cryptography.
Input:
7
Output:
prime
Explanation:
Factors for 7 is 1 and itself then it is prime number.
Code:
x=int(input())
c=0
for i in range(2,x):
if(x%i==0):
c=1
break
if(c==1):
print("not a prime")
else:
print("prime")
c=0
for i in range(2,x):
if(x%i==0):
c=1
break
if(c==1):
print("not a prime")
else:
print("prime")
Note:
Hello Guys, Don't Stop Learning keep Going..............