tranform a for into a while but keep the same properties?

后端 未结 0 1189
孤城傲影
孤城傲影 2020-12-06 03:51
def p(l):
x = True
y = len(l)


for z in range(y):
    if (sum(l[z+1:]) == sum(l[:z])):
        x = False
        return z

if x:
    return -1

So I

相关标签:
回答
  • 消灭零回复
提交回复
热议问题