파이썬 factorial()

Jmnote (토론 | 기여)님의 2018년 8월 10일 (금) 23:56 판 (새 문서: ==개요== ;Python factorial() ;파이썬 factorial() <source lang='Python'> from math import factorial print( factorial(4) ) </source> <source lang='Python'> def factorial(x): r...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

Python factorial()
파이썬 factorial()
from math import factorial
print( factorial(4) )
def factorial(x):
    result = 1
    for i in range(2,x+1):
        result *= i
    return result

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}