Reverse Three Values

Reversing a list is a basic technique that comes up often when working with element order. Write a function reverse3 that takes a list nums with exactly 3 numbers. Return a new list with the same elements in reverse order.

Примеры

Ввод
[1, 2, 3]
Вывод
[3, 2, 1]
Ввод
[5, 11, 9]
Вывод
[9, 11, 5]
Ввод
[7, 0, 0]
Вывод
[0, 0, 7]

Нужно реализовать

def reverse3(nums: list[int]) -> list[int]:

Теги

listsarray
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Visible tests
1
Input
[1,2,3]
Expected[3,2,1]
2
Input
[5,11,9]
Expected[9,11,5]
3
Input
[7,0,0]
Expected[0,0,7]
4
Input
[1,1,2]
Expected[2,1,1]
5
Input
[0,0,0]
Expected[0,0,0]
6
Input
[1]
Expected[1]
Focus radio
Paused · SomaFM · Fluid