December SPECIAL! For a limited time only. Get 20% discount on a LIFETIME PRO account!Want more features on Pastebin? Sign Up, it's FREE!
tweet
Guest

Untitled

By: a guest on Sep 6th, 2015  |  syntax: Python  |  size: 0.22 KB  |  views: 96  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def primes(how_many):
  2.         i = 0
  3.         primes = []
  4.         while i < how_many:
  5.                 flag = False
  6.                 for x in range(1, int(sqrt(i)) ):
  7.                         if i % x == 0:
  8.                                 flag = True
  9.                 if flag:
  10.                         continue
  11.                 i += 1
  12.                 primes.append(i)
  13.         return primes
clone this paste RAW Paste Data
Top