Created
March 10, 2022 01:52
-
-
Save brentxphillips/75b557b5f76c080f3832c9d7324e3ea1 to your computer and use it in GitHub Desktop.
Recursion practice loop created from a while loop
This file contains 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
# Recursion practice | |
# Recurion loop version of a while loop[] | |
triangle = ["one"] | |
def pyramid(): | |
print(triangle) | |
triangle.append("one") | |
line_len = len(triangle) | |
if line_len > 5: | |
print("End") | |
else: | |
pyramid() | |
pyramid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment