GH avatar Bite 37. Rewrite a for loop using recursion

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!

161 out of 163 users completed this Bite.
Will you be Pythonista #162 to crack this Bite?
It takes an average of ~31 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 3.0 on a 1-10 difficulty scale.
» You can do it! 😌

Buy Now Login and get coding
We use Python 3.7