我想出了这样的事情:
def sumLargestNumbers (x):
for largest_integer in x:
largest_integer = max(sumLargestNumbers)
integers.remove(largest_integer)
return (sum(largest_integer, integers.remove))
但它给了我这个错误:
TypeError Traceback (most recent call last)
<ipython-input-15-2b77832140c8> in <module>
1 x = [1, 10]
----> 2 print(sumLargestNumbers([1, 10]))
<ipython-input-14-b3557ee34db3> in sumLargestNumbers(x)
1 def sumLargestNumbers (x):
2 for largest_integer in x:
----> 3 largest_integer = max(sumLargestNumbers)
4 integers.remove(largest_integer)
5 return (sum(largest_integer, integers.remove))
TypeError: 'function' object is not iterable
有什么帮助吗?
慕的地10843
至尊宝的传说
相关分类