# Write a function swap, that swaps the first and last elements of a list parameter 

def swap(item_list): 
    item_list[0], item_list[-1] = item_list[-1], item_list[0]

item = input().split()

swap(item_list)
print(item_list)

# swap() takes in one list argument. To swap the list elements, a temporary variable is created to store the value of the first element in the list 
# Then the first element is assigned with the value of the last element, and the last element is assigned with the value of the temporary variable. 

# Lists are mutable, so after swap() executes, item_list contains the new values modified within swap()

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: