Range() and tri_recursion()

Total Post:113

Points:791
 557  View(s)
Ratings:
Rate this:

Difference between Range() and tri_recursion() in python ?

  1. Post:140

    Points:984
    Re: Range() and tri_recursion()

    range() Function:

    its a loop which is having set of number we can use the range() function. 

    for x in range(2, 6): 
      print(x)

    Recursion :

    Python also accepts function recursion,which means a defined function can call itself. It means that a function calls itself. 

    def tri_recursion(k): 
      if(k>0):
        result = k+tri_recursion(k-1)
        print(result)
      else:
        result = 0
      return result
    print("\n\nRecursion Example Results")
    tri_recursion(6)

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.