Skip to content

Instantly share code, notes, and snippets.

@ro6ley
Created March 6, 2017 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ro6ley/f79400c887a8b08fd6cb535eabdebff8 to your computer and use it in GitHub Desktop.
Save ro6ley/f79400c887a8b08fd6cb535eabdebff8 to your computer and use it in GitHub Desktop.
My solution to the challenges sent via email
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]))
@profnandaa
Copy link

Looks good! The only thing is that you are using the sum keyword. So if your program was using sum inbuilt function anywhere, it will be overridden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment