prime numbers
Isn't that harder than the actual question?
Isn't that harder than the actual question?
def is_prime(x):
if x%3 and x%2:
return True
else:
return False
print is_prime(4)
print is_prime(7)
EDIT: Oops, nevermind... you're all right and I'm wrong. I'm not fixing this code so everyone can see exactly how I screwed up.Edit: Perhaps you should keep this in mind next time you declare 99% of programmers incompetent because they made a typo when you asked them to write code down with pencil and paper in a high pressure interview situation.
It's amazing how much doing a few interviews inflates people egos.
"What's the first (positive) number my function will have wrong?"