Skip to content

Commit da03d20

Browse files
Add code of factorial
1 parent a6f8bf6 commit da03d20

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sampleFactorial.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def fatorial(n):
2+
if(n == 0 or n == 1):
3+
return 1
4+
else:
5+
return fatorial(n-1)*n
6+
7+
n = int(input("Please, enter the numb: "))
8+
fatorial(n)
9+
print(fatorial(n))

0 commit comments

Comments
 (0)