Skip to content

Commit f96120d

Browse files
Tanmay Dattat2013anurag
authored andcommitted
fix factorial for input less than 1
1 parent 7e34216 commit f96120d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

recursion/factorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def factorial(num):
2-
if num == 1:
2+
if num <= 1:
33
return 1
44
else:
55
return num * factorial(num - 1)

0 commit comments

Comments
 (0)