Skip to content

Commit

Permalink
Merge pull request #1 from mihirapappu/mihirapappu-patch-1
Browse files Browse the repository at this point in the history
factorial of a number
  • Loading branch information
mihirapappu authored Oct 3, 2019
2 parents 1803a25 + 47b0c07 commit 61e5b83
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions factorial of a number
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)
n=int(input("Input a number to compute the factiorial : "))
print(factorial(n))

0 comments on commit 61e5b83

Please sign in to comment.