← Problem book: Python
Lesson 69 of 96 · 10 XP
Swap the ends
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
The first line contains the count of numbers n (1 ≤ n ≤ 100), the second — the n integers themselves, separated by spaces.
Swap the first and the last number and print all the numbers, separated by spaces.
Example
Input:
4
1 2 3 4
Output:
4 2 3 1
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.