Swap first and last elements of a list in place.
Implement this function:
def swap_first_last(l: list) -> None:
Write the function only — the arguments are read for you and the return value is printed automatically.
This function changes its argument in place and returns nothing; the updated l is what gets printed.
Arguments arrive as one Python literal per line, in this order: l.
Input
[1, 2, 3, 4]
Output
[4, 2, 3, 1]