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)
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
range() Function:
its a loop which is having set of number we can use the range() function.
Recursion :
Python also accepts function recursion,which means a defined function can call itself. It means that a function calls itself.