Skip to content

Commit 957a4c0

Browse files
author
Michaela Rousova
committed
04 Factorial
1 parent ccf00a2 commit 957a4c0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

06/tasks/task_04_factorial.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ def factorial(n: int) -> int:
44
"""
55
Vrátí faktoriál čísla n.
66
"""
7+
if n == 0 or n == 1:
8+
return 1
9+
else:
10+
return n * factorial(n-1)
11+
712

0 commit comments

Comments
 (0)