Skip to content

Instantly share code, notes, and snippets.

@m0xb
Created October 4, 2017 22:51
Show Gist options
  • Select an option

  • Save m0xb/223c2aed8c5dd737c317b1d6e973eae5 to your computer and use it in GitHub Desktop.

Select an option

Save m0xb/223c2aed8c5dd737c317b1d6e973eae5 to your computer and use it in GitHub Desktop.
$ cat countdown_recursive.py
def countdown(n):
print(n)
if n > 1:
countdown(n - 1)
countdown(5)
$ python3 countdown_recursive.py
5
4
3
2
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment