We use Python 3.6

go back Level: Beginner (img: BG / score: 2) level Bite 37. Rewrite a for loop using recursion

66 out of 67 users completed this Bite ...
Will you be Pythonista #67 to crack this Bite?
Average Bite difficulty 1-10 rating: 3.0
» You can do it! 😌

Although you have to be careful using recursion it is one of those concepts you want to at least understand. It's also commonly used in coding interviews :)

In this beginner Bite we let you rewrite a simple countdown for loop using recursion. See countdown_for below, it produces the following output:

$ python countdown.py
10
9
8
7
6
5
4
3
2
1
time is up

You will be tested on having the same output, making it work with another start value, and of course if you used recursion. Have fun!

Github login button