Python Program to Check Prime Number or Not


-

-

Example:

Copied
print("Enter any Number: ")
num = int(input())

temp = 0
for i in range(2, num):
    if num%i==0:
        temp = 1
        break

if temp==0:
    print("\nIt is Prime Number")
else:
    print("\nIt is not Prime Number")

Output:

Enter any Number:
55
It is not Prime Number