पायथन गणित.प्रोड () विधि
उदाहरण
दिए गए पुनरावर्तनीय से तत्वों का गुणनफल लौटाएं:
# 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 |