ShriRam Changed status to publish August 18, 2023
n=int(input(“Enter Number “))
t=0
for i in range(2, n, 1):
r = n % i
if(r == 0):
t=1
break
if(t==0):
print(“Prime”)
else:
print(“Not Prime”)
OR
num = int(input(“Enter a number: “))
if num > 1:
for i in range(2, num):
if (num % i) == 0:
print(num, “is not a prime number”)
print(i, “times”, num // i, “is”, num)
break
else:
print(num, “is a prime number”)
else:
print(num, “is not a prime number”)
ShriRam Changed status to publish August 18, 2023