Multiply the Whole List

A product is useful when values should build on each other through multiplication instead of simple addition. Write grow, which takes a non-empty list of numbers arr and returns the result of multiplying all its elements. Start with the first number and multiply it by each of the remaining numbers in order.

Примеры

Ввод
[1, 2, 3]
Вывод
6
Ввод
[4, 1, 1, 1, 4]
Вывод
16
Ввод
[2, 2, 2, 2, 2]
Вывод
32

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

def grow(arr: list[int]) -> int:

Теги

listsarraymath
PostgreSQLv16

Čia bus kodo vykdymo rezultatas

Visible tests
1
Input
[1,2,3]
Expected6
2
Input
[4,1,1,1,4]
Expected16
3
Input
[2,2,2,2,2]
Expected32
4
Input
[5]
Expected5
5
Input
[1,1,1]
Expected1
6
Input
[1,1,1,1,1]
Expected1
Focus radio
Paused · SomaFM · Fluid