파이썬 math.prod() 메서드
예시
주어진 iterable에서 요소의 곱을 반환합니다.
# Import math Library
import math
sequence = (2, 2, 2)
#Return the product of the elements
print(math.prod(sequence))
정의 및 사용
이 math.prod()
메서드는 주어진 iterable에서 요소의 곱을 반환합니다.
통사론
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 에서 요소의 곱 |
---|---|
파이썬 버전: | 3.8 |