PYTHON CODE PLEASE
in python Purpose The purpose of this assignment is to give you practice with writing loops and introduce you to lists. Problem Write a program that receives a series of numbers from the user and allows the user to press the Enter key to indicate that inputs are done. As each number is input, it is stored into a list. After the user presses the Enter key (i.e., they enter nothing as input), the program should do the following: - If the list has no elements, just prints "Empty List". - If the list has at least one element, you must print: The total number of items in the list The list itself sorted in ascending order. The sum of all the elements in the lis. The average of the elements in the list. The largest value in the list. The smallest value in the list. The first half of the list. (If the list has an odd number of elements, you can exclude the middle element. For example, if there are 5 elements, just print the first 2 .) Each individual list element. You must use a loop to iterate through the list to print each element, and each element must be separated by a tab character (t). Inputs Any input other than a number or the Enter key should be caught using an exception with an appropriate error message and the program should continue seeking input. Comments Make sure your code is sufficiently commented! In this casse, you'll want to include your name and denote where input is collected, where errors are handled, and where the various list calculations occur. Hint for stopping input An easy way to capture whether the Enter key was pressed or not is to initially accept the input as a string. and then convert it to integer, all within a Try block: try: input string = input("Enter a Number.") number = int(input string) If it causes an exception, in your except clause you can check for cither the value of the input_string variable to be an empty string (which is two double quotes without anything in it) or the length of the string being zero (the function len can be used). If it's not an empty string but invalid input (like nonnumeric input) you must continue to seck input after a proper error message