Prime number

This is a python program to check given is a prime no or not.

print("Enter a number to be check whether it is prime or not :")
num=int(input())

Temp=0
i=2
while i<(num/2):
    if num%i==0:
        Temp=1
        break
    i+=1

if Temp==1:
    print(f"{num} is not a prime number")
else:
    print(f"{num} is a prime number")

 

%d bloggers like this: