Post

Day 34 of 100 Days of Python

Practising Recursion

1
2
3
4
5
6
7
8
9
# Reverse count to zero in recursion

def countn(n):
    if n ==0:
        print(0)
        return
    print(n)
    countn(n-1)
countn(5)
This post is licensed under CC BY 4.0 by the author.

Trending Tags