我遇到了一个输入法问题,我试图获取由空格分隔的整数列表。我的代码如下:Python - 对Ints列表进行排序用户输入
def numberStore():
numberList = input("Enter list of numbers seperated by spaces ").split(" ")
print("The lowest number is" , listLowestNumber(numberList))
然后我有一个函数返回的最低数量已输入列表。
def listLowestNumber(list):
list.sort()
return list[0]
然而,当我执行该功能numberStore,似乎只由第一个数字,这些数字排序例如输入值40 9 50将返回的值40作为最低数目。谢谢你的帮助!
'分钟(the_list,键= INT)'是你想要什么 – JBernardo 2013-03-16 22:49:59