HomeEducation Factorial in Python bykiran -June 29, 2023 0 Factorial in PythonThis Python code calculates the factorial of a number.def factorial(n): if n == 0: return 1 else: return n * factorial(n - 1)print(factorial(5))The output of the code is 120. Tags: Education Facebook Twitter