为什么答案是(2,0)不是(2,1)
def sub_sum(num): sum1=0 sum2=0 if num%2==0: sum1=num+sum1 else: sum2=num+sum2 return sum1,sum2 L=[1,2] for i in L: result=sub_sum(i) print(result)
def sub_sum(num): sum1=0 sum2=0 if num%2==0: sum1=num+sum1 else: sum2=num+sum2 return sum1,sum2 L=[1,2] for i in L: result=sub_sum(i) print(result)
2021-02-03
举报