Merge pull request #244 from arcsinecosine/master

My solution to the problem
This commit is contained in:
Harshil 2018-01-22 07:16:11 +05:30 committed by GitHub
commit c4234192fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,32 @@
def mulitples(limit):
xmulti = []
zmulti = []
z = 3
x = 5
temp = 1
while True:
result = z * temp
if (result < limit):
zmulti.append(result)
temp += 1
continue
else:
temp = 1
break
while True:
result = x * temp
if (result < limit):
xmulti.append(result)
temp += 1
continue
else:
temp = 1
break
return (sum(zmulti) + sum(xmulti))
print (mulitples(100))

View File

@ -0,0 +1,13 @@
def fib(n):
ls = []
a,b = 0,1
n += 1
for i in range(n):
if (b % 2 == 0):
ls.append(b)
else:
pass
a,b = b, a+b
print (sum(ls))
return None
fib(10)