Countdown List
A reversed sequence is like a countdown before a launch: the numbers go from bigger to smaller. Write reverse_seq, which takes a natural number n and returns a list of numbers from n down to 1, inclusive. The order must be strictly descending.
Примеры
Ввод
5Вывод
[5, 4, 3, 2, 1]Ввод
1Вывод
[1]Ввод
3Вывод
[3, 2, 1]Нужно реализовать
def reverse_seq(n: int) -> list[int]:
Теги
arraymath
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
5Expected
[5,4,3,2,1]2
Input
1Expected
[1]3
Input
3Expected
[3,2,1]4
Input
9Expected
[9,8,7,6,5,4,3,2,1]5
Input
2Expected
[2,1]6
Input
10Expected
[10,9,8,7,6,5,4,3,2,1]Focus radio
Paused · SomaFM · Fluid