Python program to interchange first and last elements in a list
Given a list, write a Python program to swap the first and last element of the list using Python. Examples: The last element of the list can be referred to as a list[-1]. Therefore, we can simply swap list[0] with list[-1]. [GFGTABS] Python # Initialize a list my_list = [1, 2, 3, 4, 5] # Interchange