Python program that takes multiple integer from the user & prints a list and checks if it is sorted.

Python Program

In the main part of your program, generate a random number between 1 and 10 and store it in variable k; prompt the user to enter k integers and store them in a list. Write a function called is_sorted that accepts a list of numbers as a parameter and returns True if the list is in sorted (nondecreasing) order and False otherwise. For example, if lists named list1 and list2 store [4, 23, 33, 10, 50, 60, 77, 90] and [20, 30, 100], respectively, the calls is_sorted(list1) and is_sorted(list2) should return False and True, respectively. Assume the list has at least one element. A one-element list is considered to be sorted.

Sample two separate runs: