Positive integer greater than 1 which has no other factors except 1 and the number itself is called a prime number. 2, 3, 5, 7 etc. are prime numbers as they do not have any other factors. But 6 is not prime (it is composite) since, 2 x 3 = 6
.
num=int(input("enter the numbr : "))
for i in range (2,num):
if (num%i != 0 ):
print(f"{num} is a prime number ")
break
else:
print (f"{num} is not prime number ")
break;
video :
No comments:
Post a Comment