Write a program that reads integers from the user and stores them in a list. Use 0 as a sentinel value to mark the end of the input. Once all of the values have been read your program should display them (except for the 0) in reverse order, with one value appearing on each line.
Hint:
Start by solving the previous exercise
def main(): list_of_numbers = [] #We use this boolean to indicate that we are not done done = False while not done: number = int(input("Enter a number. Exit with 0: ")) if number != 0: list_of_numbers.append(number) else: done = True sorted_list = sorted(list_of_numbers, key=int, reverse=True) print(sorted_list) if __name__ == '__main__': main()