Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
15th - For using the 'cycle' keyword solution in Creative category for Funny Addition by H0r4c3
from itertools import cycle
def checkio(data):
sum, c = 0, 0
for i in cycle(data):
c+=1
sum += i
if c > 1:
return sum
if __name__ == '__main__':
assert checkio([5, 5]) == 10, 'First'
assert checkio([7, 1]) == 8, 'Second'
print('All ok')
April 30, 2023