Loading...
Loading...
Loading...
A dispatcher wants the first and last order of the day swapped. Read the list, swap them in place, and print the list.
Example
Input
4 10 20 30 40
Output
40 20 30 10
First and last trade places.
Try the problem first. Open one hint at a time.
Index 0 is the first item and index -1 the last.
Tuple assignment swaps both in one line.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor