Recursive definition of function factorial : Function Recursive : Buildin Function PYTHON examples


PYTHON examples » Buildin Function » Function Recursive »

 

Recursive definition of function factorial


Recursive definition of function factorial


def factorialnumber ):

   if number <= 1:   # base case
      return 1
   else:
      return number * factorialnumber - )  # recursive call

for i in range11 ):
   print "%2d! = %d" i, factorial) )


           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Buildin Function
» Function Recursive