Skip to content

Commit

Permalink
Merge pull request #20 from anapauladsmendes/factorial
Browse files Browse the repository at this point in the history
Add code of factorial
  • Loading branch information
ashutosh97 authored Oct 14, 2017
2 parents a6f8bf6 + da03d20 commit 0af77e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sampleFactorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def fatorial(n):
if(n == 0 or n == 1):
return 1
else:
return fatorial(n-1)*n

n = int(input("Please, enter the numb: "))
fatorial(n)
print(fatorial(n))

0 comments on commit 0af77e5

Please sign in to comment.