Light Mode
Dark Mode
Code works on my computer, but not on here

I'm getting the correct result on my editor, but when I copy the code into checkio, it's failing checkio([2,2,2,2,2,2]). Any ideas?

v1 = 0
def checkio(data):
    if len(data)>0:
        global v1
        data_iter = iter(data)
        v1 += next(data_iter)
        data.pop(0)
        checkio(data)
    return v1
Created: March 19, 2020, 7:47 p.m.
Updated: March 22, 2020, 8:43 a.m.
0
11
User avatar
siromar