Run
# Given list my_list = [10, 20, 30, 40, 50, 60] # Number of elements to slice from the end N = 3 # Slice the list sliced_list = my_list[-N:] # Print sliced list print(sliced_list)
Output