طريقة بايثون math.prod ()
مثال
إرجاع ناتج العناصر من المعطى التكراري:
# Import math Library
import math
sequence = (2, 2, 2)
#Return the product of the elements
print(math.prod(sequence))
التعريف والاستخدام
تُرجع math.prod()
الطريقة حاصل ضرب العناصر من المعطى التكراري.
بناء الجملة
math.prod(iterable, start)
قيمه المعامل
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 |
تفاصيل تقنية
قيمة الإرجاع: | حاصل ضرب العناصر من المتكرر |
---|---|
نسخة بايثون: | 3.8 |