Skip to content

Instantly share code, notes, and snippets.

@mukulrawat1986
Created January 14, 2015 13:32
Show Gist options
  • Save mukulrawat1986/70ca4bb546f9c6c7dc73 to your computer and use it in GitHub Desktop.
Save mukulrawat1986/70ca4bb546f9c6c7dc73 to your computer and use it in GitHub Desktop.
Project Euler Problem 1 in python
# Enter your code here. Read input from STDIN. Print output to STDOUT
def func(n):
return sum([i for i in xrange(n) if i%3==0 or i%5==0])
t = int(raw_input())
while t>0:
n = int(raw_input())
print func(n)
t-=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment