Python Numbers sort
Python
Download (.zip)
# example of reading in a bunch of numbers and then writing them out # sorted using the sort() method of lists. number = input("input the number of numbers") alist = [] while number>0 : x = input("input a number") alist.append(x) print alist number = number -1 alist.sort() print alist for x in alist: print x
|