Created
January 14, 2015 13:32
-
-
Save mukulrawat1986/70ca4bb546f9c6c7dc73 to your computer and use it in GitHub Desktop.
Project Euler Problem 1 in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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