Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Generator solution in Creative category for Funny Addition by yoichi
from copy import deepcopy
def makegen(data):
d = deepcopy(data)
while d:
yield d.pop()
def checkio(data):
return sum(makegen(data))
if __name__ == '__main__':
assert checkio([5, 5]) == 10, 'First'
assert checkio([7, 1]) == 8, 'Second'
print('All ok')
Dec. 18, 2014
Comments: