Swap values at even and odd indices in place. Example: [1,2,3,4] => [2,1,4,3]
Implement this function:
def swap_even_and_odd_indices(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
[2, 1, 4, 3]