PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
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!
Public Pastes
Untitled
3 sec ago
Untitled
11 sec ago
Untitled
32 sec ago
dasdadsa
36 sec ago
Untitled
52 sec ago
The Best Smasher o...
58 sec ago
Untitled
1 min ago
Untitled
1 min ago
tweet
Untitled
By: a guest on
Sep 6th, 2015
| syntax:
Python
| size: 0.18 KB | views:
77
| 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)
def
primes
(
how_many
)
:
primes
=
[
]
i
=
1
while
len
(
primes
)
<
how_many:
for
x
in
primes:
if
i % x
==
0
:
break
else
:
primes.
append
(
i
)
i +
=
1
return
how_many
clone
this paste
RAW Paste Data
def primes(how_many): primes = [] i = 1 while len(primes) < how_many: for x in primes: if i % x == 0: break else: primes.append(i) i += 1 return how_many
Top