First time user of this group. I have a quick question about the python prime number program listed below. In the first loop of ... for x in range (2,n): .... is n = 2 in this case? If yes, why does the program correctly say it is a prime number?
I can follow the rest of the logic but and struggling with the first iteration
Thanks
for n in range (2,15) :
for x in range(2, n):
if n % x == 0:
print n, 'equals', x, '*', n/x
break
else:
print n, 'is a prime number'

See more answers at brainly.com

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.