Pi Digits
A list can be built not only from calculations, but also from values that are already known. Write a function make_pi that takes a number n from 0 to 11. Return a list with the first n digits of pi: 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5.
Примеры
Ввод
1Вывод
[3]Ввод
2Вывод
[3, 1]Ввод
3Вывод
[3, 1, 4]Нужно реализовать
def make_pi(n: int) -> list[int]:
Теги
listsarray
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésVisible tests
1
Input
1Expected
[3]2
Input
2Expected
[3,1]3
Input
3Expected
[3,1,4]4
Input
0Expected
[]5
Input
11Expected
[3,1,4,1,5,9,2,6,5,3,5]6
Input
1000Expected
[3,1,4,1,5,9,2,6,5,3,5]Focus radio
Paused · SomaFM · Fluid