Factorial of a number
One line python code to calculate the factorial of a number
Python: 3.0    Anurag Rana    06 Sep 2021   0
Login to upvote
1
2
3
# One line python code to calculate the factorial of a number - pythonsnippets.dev
# using reduce function
reduce(lambda x, y: x * y, range(1, n+1))
Copy | Download as: .py file   PNG
Share on: FB   Twitter   LinkedIn   WA
©2021 - code108labs   Contributors   Hosted on DigitalOcean   Partner website: pythoncircle.com