We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39b515b commit 172fcbfCopy full SHA for 172fcbf
factorial.py
@@ -0,0 +1,8 @@
1
+def factorial(n):
2
+
3
+ return 1 if (n==1 or n==0) else n * factorial(n - 1);
4
5
6
+num = int(input("Enter a number: "));
7
8
+print("Factorial of",num,"is",factorial(num))
0 commit comments