what's wrong with this (trying to find a prime number)
import math
candidate=29
if (candidate/2)*2 == candidate:
print candidate, 'is even'
else:
print candidate, 'is odd'
for i in range(2,candidate):
if candidate % i == 0:
print candidate, 'is not a prime'
else:
print candidate, 'is a primo'

See more answers at brainly.com

Why not use the following as the first line?
if (candidate%2) != 0:

Oops, that should be the reverse:
if (candidate%2) == 0:

That's better than expanding to if candidate % i == 0?

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.