Skip to content

Commit f63d74b

Browse files
authored
Update solution.hide.py
1 parent 18f9426 commit f63d74b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
def fact(x):
2-
if x == 0:
3-
return 1
4-
return x * fact(x - 1)
5-
6-
x=int(input())
7-
print (fact(x))
8-
1+
# Your code here
2+
def factorial(x):
3+
result = 1
4+
for i in range(1, x + 1):
5+
result *= i
6+
return result
97

10-
# or
8+
print(factorial(5))
119

12-
# Your code here
13-
import math
14-
def factorial(num):
15-
return math.factorial(num)
10+
### Solution 2 ###
1611

17-
print(factorial(8))
12+
# import math
13+
#
14+
# def factorial(x):
15+
# return math.factorial(x)
16+
#
17+
# print(factorial(8))

0 commit comments

Comments
 (0)