We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2993936 commit 1b405e1Copy full SHA for 1b405e1
solutions/02.py
@@ -0,0 +1,17 @@
1
+# 01.
2
+# Write a program which can compute the factorial of a given numbers.
3
+# The results should be printed in a comma-separated sequence on a single line.
4
+# Suppose the following input is supplied to the program:
5
+# 8
6
+# Then, the output should be:
7
+# 40320
8
+
9
+def factorial(x):
10
+ if(x == 1):
11
+ return 1
12
13
+ return x * factorial(x - 1)
14
15
+x = int(input('Type your number: '))
16
17
+print(factorial(x))
0 commit comments