def sumlist(l):
li=[]
for x in l:
if type(x) is int:
li.append(x)
return sum(li)
nums = eval(input())
sumv = sumlist(nums)
print(sumv)
嵌套列表不熟悉,导致上面的代码不正确
def sumlist(l):
li=[]
for x in l:
if type(x) is int:
li.append(x)
return sum(li)
nums = eval(input())
sumv = sumlist(nums)
print(sumv)
嵌套列表不熟悉,导致上面的代码不正确