Created
March 6, 2017 11:27
-
-
Save ro6ley/f79400c887a8b08fd6cb535eabdebff8 to your computer and use it in GitHub Desktop.
My solution to the challenges sent via email
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
def sum_even(a): | |
sum = 0 | |
for num in a: | |
if num%2 == 0: | |
sum+=num | |
return sum | |
def super_sum(a): | |
sum = 0 | |
for num in a: | |
num = str(num) | |
for i in num: | |
i = int(i) | |
sum+=i | |
return sum | |
print(sum_even([10, 5, 6, 1])) | |
print(super_sum([120, 13, 45])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks good! The only thing is that you are using the
sum
keyword. So if your program was usingsum
inbuilt function anywhere, it will be overridden.