x=11
for n in range(1,x+1):
#print(n)
if (x%n)==0:
if n == 1 and n==x:
print(f"{x} is a prime number")
break
else:
#print(n)
print(f"{x} is not a prime number")
break
the output is: 11 is not a prime number. According to my knowledge the logic is correct but why this wrong output.
Aucun commentaire:
Enregistrer un commentaire