diff --git a/Python/Factorial.py b/Python/Factorial.py new file mode 100644 index 00000000..0082eaeb --- /dev/null +++ b/Python/Factorial.py @@ -0,0 +1,10 @@ +# Python 3 program to find +# factorial of given number +def factorial(n): + + # single line to find factorial + return 1 if (n==1 or n==0) else n * factorial(n - 1) + +# Driver Code +num = 5 +print("Factorial of",num,"is",factorial(num))