Advertisement
RapidR3D

Is_Prime//

Mar 15th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import math
  2.  
  3. def is_prime(num):
  4.     if num < 2:
  5.         return False
  6.  
  7.  
  8.     for i in range(2, int(math.sqrt(num)) + 1):
  9.          if num % i == 0:
  10.              return False
  11.     return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement