Created
October 4, 2017 22:51
-
-
Save m0xb/223c2aed8c5dd737c317b1d6e973eae5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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