Python 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 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဒြပ်စင်၏ ထုတ်ကုန်သည် iterable မှဖြစ်သည်။ |
---|---|
Python ဗားရှင်း- | ၃.၈ |