How python calculates the factorial of any number in a row
Editor to share with you how python calculates the factorial of any number in a row, I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.
Calculates the factorial of any number in a row. Python 2.x.result = (lambda k: reduce (int.__mul__, range (1) (1) (3) print (result) #-> 6Python 3.x.import functoolsresult = (lambda k: functools.reduce (int.__mul__, range (1) (3) print (result)
#-> 6
The above is all the content of the article "how to calculate the factorial of any number in a row by python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!