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


PYTHON examples » 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 Function
» Function Recursive