4 ms·
# "close enough" programmer import math def fact(x): math.sqrt(2*math.pi*n) * math.pow(n/math.e, n) print fact(6) # lazy-er programmer def fact(x
by notaddicted 17y ago
# "close enough" programmer
import math
def fact(x):
math.sqrt(2*math.pi*n) * math.pow(n/math.e, n)
print fact(6)
# lazy-er programmer
def fact(x):
factorials = {6:720} # found on my calculator, add more as they come up
if factorials.has_key(x):
return factorials[x]
else:
raise NotImplementedError
print fact(6)
- Vivtek 17y agoNotImplementedError - that kills me!