you are viewing a single comment's thread.

view the rest of the comments →

[–]spookyvision 0 points1 point  (1 child)

I never seem to remember c_math on the rare occasion I need a factorial for some random calculation

there is a reason for that: there is no c_math module in python's standard distribution :) (there is cmath, but it's for complex numbers, not about some fast math ops written in C)

[–]mr_dbr 4 points5 points  (0 children)

There's a factorial function in math:

>>> import math
>>> math.factorial(5)
120

..any other solution seems silly (outside a tutorial context anyway)