How on Factorial

Geobird a1chandan at gmail.com
Wed Oct 27 02:25:47 EDT 2010


  I  am a beginner in Python and would ask for a help.


I  was searching for  smaller  version  of  code  to calculate
factorial . Found  this one
def fact(x):
	return x > 1 and x * fact(x - 1) or 1

 But I don't  really get how (  ....x > 1 and x * fact(x - 1)....)
works .



More information about the Python-list mailing list