Countdown List

This pattern works like a countdown: start from a larger number and step down to one. Write a function make_pile that takes a number n and returns a list of numbers from n down to 1. If n is 0, return an empty list.

Примеры

Ввод
3
Вывод
[3, 2, 1]
Ввод
1
Вывод
[1]
Ввод
0
Вывод
[]

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

def make_pile(n: int) -> list[int]:

Теги

listsarraymath
PostgreSQLv16

Hier verschijnt het resultaat van je code

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