在Python中,什么是可用于读取列表中最大数字的方法?我的尝试如下:Python:我如何编写一个读取10个不同整数并打印出具有最大值的程序?
list = [a, b, c, d, e, f, g, h, i, j]
print max(list)
编辑(解决方案):使用for循环。
userInput = []
for i in range(10):
userInput.append(int(input("Enter a number")))
print(max(userInput))
您在这里犯了几个错误。我建议看看[官方Python教程](https://docs.python.org/3.4/tutorial/index.html)。 – TigerhawkT3