Python matematik.prod() Yöntem
Örnek
Verilen yinelenebilir öğeden öğelerin ürününü döndürün:
# Import math Library
import math
sequence = (2, 2, 2)
#Return the product of the elements
print(math.prod(sequence))
Tanım ve Kullanım
Yöntem math.prod()
, verilen yinelenebilir öğeden öğelerin ürününü döndürür.
Sözdizimi
math.prod(iterable, start)
Parametre Değerleri
Parameter | Description |
---|---|
iterable | Required. Specifies the elements of the iterable whose product is computed by the function |
start | Optional. Specifies the starting value of the product. Default value is 1 |
Teknik detaylar
Geri dönüş değeri: | Yinelenebilir öğelerin ürünü |
---|---|
Python Sürümü: | 3.8 |