반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Apache
- PySpark
- PANDAS
- hive
- PostgreSQL
- Google Spreadsheet
- Tkinter
- GIT
- dataframe
- Python
- math
- google apps script
- 파이썬
- Redshift
- Google Excel
- django
- c#
- Mac
- Kotlin
- Java
- gas
- Github
- numpy
- matplotlib
- Excel
- array
- SQL
- list
- string
Archives
- Today
- Total
목록factorial (1)
달나라 노트
Python math : factorial() (!, factorial, 팩토리얼)
math library의 factorial() method는 특정 숫자의 factorial 값을 return합니다. Syntax math.factorial(x) x는 숫자입니다. 전달받은 x의 팩토리얼 값을 return합니다. 팩토리얼 값을 계산하기 때문에 x는 양의 정수만을 받습니다. (실수, 음수 등을 전달하면 error가 발생합니다.) 예시를 봅시다. import math print(math.factorial(5)) -- Result 120 - math.factorial(5) 5!의 값을 계산하여 return합니다. 5! = 5 * 4 * 3 * 2 * 1 = 120 이므로 120이 return됩니다.
Python/Python math
2022. 11. 8. 21:07