Index List

This kind of list is often useful when preparing indices or looping over positions. Write a function fizz_array that takes a non-negative number n. Return a list of numbers from 0 to n - 1, inclusive, in the correct order.

Примеры

Ввод
4
Вывод
[0, 1, 2, 3]
Ввод
1
Вывод
[0]
Ввод
10
Вывод
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

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

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

Теги

listsarray
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

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