I am having an issue with my input method, I am trying to get a list of ints seperated by spaces. My code is below:
def numberStore():
numberList = input("Enter list of numbers seperated by spaces ").split(" ")
print("The lowest number is" , listLowestNumber(numberList))
I then have a function to return the lowest number of the list that has been input.
def listLowestNumber(list):
list.sort()
return list[0]
However when I execute the function numberStore, it only seems to sort the numbers by the first digit, for example entering the values 40 9 50 will return a value of 40 as the lowest number. Thanks for any help!
min(the_list, key=int)is what you want