Switch Places

Swapping values is a small action that appears all the time in sorting, games, and data handling. Given two numbers a and b, return them in the opposite order. The result should contain the old b first, then the old a.

Примеры

Ввод
2, 3
Вывод
(3, 2)
Ввод
3, 4
Вывод
(4, 3)
Ввод
67, 12
Вывод
(12, 67)

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

def swap(a: int, b: int) -> tuple[int, int]:

Теги

math
PostgreSQLv16

Hier verschijnt het resultaat van je code

Visible tests
1
Input
2, 3
Expected[3,2]
2
Input
3, 4
Expected[4,3]
3
Input
67, 12
Expected[12,67]
4
Input
3, -4
Expected[-4,3]
5
Input
2, 12
Expected[12,2]
6
Input
4, -100
Expected[-100,4]
Focus radio
Paused · SomaFM · Fluid