答案运行的时候不能忽略字符串,有人可以帮忙解答下吗?
def sum(x):result=0
for each in x:
if (type(each)==int)or(type(each==float)):
result+=each
else:
continue
return result
print(sum()) def sum(x):
result=0
for each in x:
if (type(each)==int)or(type(each)==float):#这里括号写错位置了
result+=each
else:
continue
return result
print(sum()) 嗯嗯,已解决,谢谢 我也想说你那or后边的括号标错了,再看楼上,已经帮你解决了,记得选择最佳答案
页:
[1]