Advertisement
foreverbule2003

Untitled

Jul 23rd, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def is_prime (x):
  2.     if x == 1 :
  3.         return False
  4.     elif x == 2 :
  5.         return True
  6.     elif x == 0 :
  7.         return False    
  8.     elif x % 2 ==0 and x >2:
  9.         return False
  10.     elif x % 3 == 0 and x >3:
  11.         return False
  12.     elif x % 5 == 0 and x >5:
  13.         return False
  14.     elif x % 7 == 0 and x >7:
  15.         return False
  16.     else :
  17.         return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement