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
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
C | 17 sec ago
Untitled
21 sec ago
Untitled
24 sec ago
Untitled
26 sec ago
Untitled
28 sec ago
Untitled
42 sec ago
Untitled
33 sec ago
Untitled
32 sec ago
Raymond Euler Problem 1
By: a guest on
May 11th, 2012
| syntax:
None
| size: 0.28 KB | hits: 16 | expires: Never
download
|
raw
|
embed
|
report abuse
|
print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
#Euler problem 1
#Find the sum of all the multiples of 3 or 5 below 1000.
list=[]
multiples=[]
for n in range (1,1000):
if n%3==0:
list.append(n)
elif n%5==0:
list.append(n)
elif n%15==0:
multiples.append(n)
print sum(list)-sum(multiples)
create a
new version
of this paste
RAW Paste Data
#Euler problem 1 #Find the sum of all the multiples of 3 or 5 below 1000. list=[] multiples=[] for n in range (1,1000): if n%3==0: list.append(n) elif n%5==0: list.append(n) elif n%15==0: multiples.append(n) print sum(list)-sum(multiples)