Write a Python statement to perform the following tasks: (USE BUILT_IN FUNCTIONS / METHODS ONLY)
(i) To create a new list L1 containing the elements of list L arranged in ascending order, without modifying list L.
(ii) A statement to check whether the given character, ch is an alphabet or a number.
L = [5, 2, 9, 1]
L1 = sorted(L)
print(L1)
print(L)
The output is [1, 2, 5, 9] and then [5, 2, 9, 1]. So L is untouched. ch.isalpha() answers the question. If it is True, ch is an alphabet; otherwise it is a number. print('Alphabet' if ch.isalpha() else 'Number'). L1 = sorted(L)ch.isalpha(), or ch.isdigit() for the number check
If L is a list with 6 elements, then which of the following statements will raise an exception?