Advertisement
stiansjogren

Untitled

Nov 22nd, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def eratosthenesSieve(n):
  2. lst = []
  3. for num in range(1,n + 1):
  4.  
  5. if num > 1:
  6. for i in range(2,num):
  7. if (num % i) == 0:
  8. break
  9. else:
  10. lst.append(num)
  11.  
  12. return(lst)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement