はじめに
数学において、非負整数 n
の階乗は n!
で表され、n
以下のすべての正整数の積です。たとえば、5! = 5 x 4 x 3 x 2 x 1 = 120
です。このチャレンジでは、再帰を使って与えられた数の階乗を計算する Python 関数を書きます。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
python(("Python")) -.-> python/FunctionsGroup(["Functions"])
python(("Python")) -.-> python/ErrorandExceptionHandlingGroup(["Error and Exception Handling"])
python(("Python")) -.-> python/BasicConceptsGroup(["Basic Concepts"])
python(("Python")) -.-> python/ControlFlowGroup(["Control Flow"])
python/BasicConceptsGroup -.-> python/comments("Comments")
python/ControlFlowGroup -.-> python/conditional_statements("Conditional Statements")
python/FunctionsGroup -.-> python/function_definition("Function Definition")
python/ErrorandExceptionHandlingGroup -.-> python/raising_exceptions("Raising Exceptions")
subgraph Lab Skills
python/comments -.-> lab-13628{{"Python における再帰的な階乗の計算"}}
python/conditional_statements -.-> lab-13628{{"Python における再帰的な階乗の計算"}}
python/function_definition -.-> lab-13628{{"Python における再帰的な階乗の計算"}}
python/raising_exceptions -.-> lab-13628{{"Python における再帰的な階乗の計算"}}
end