PYTHON
Create a list in Python to perform calculation
n=int(input("Enter number of elements: ")) lst = [] for i in range(n): value = int(input(f"Enter element {i+1}: ")) lst.append(value) print("Dynamic List:", lst) #printing the length of the list print("Length of list is:", len(lst)) #Print the elements from second to fourth position using positive indexing print("2nd to 4th Position elements:",lst[1:4]) #Print the elements from position third to fifth using negative indexing print("Print the elements from position third to fifth using negative indexing",lst[-4:-1])
OUTPUT…..