Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

recursion in python

def rec(num):
    if num <= 1:
        return 1
    else:
        return num + rec(num - 1)

print(rec(50))    
 
PREVIOUS NEXT
Tagged: #recursion #python
ADD COMMENT
Topic
Name
4+6 =