mylist = [random.randrange(1,6) for i in range(5)] mysortedlist = reversed(sorted(mylist)) print mysortedlist