Created
September 14, 2017 09:24
-
-
Save codeboy101/b2784ecef7e66ee683fb6189df05ab67 to your computer and use it in GitHub Desktop.
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
def smash_yogi(limit): | |
k = 0 | |
current = 0 | |
line_limit = limit | |
while line_limit > 0: | |
# check how many numbers printed vs maximum allowed for printing | |
if current < line_limit: | |
# we want all numbers of a sequence on the same line | |
print(limit+k, end=' ') | |
current += 1 | |
k -= 1 | |
continue | |
# add new line so that next sequence is printed below the previous | |
print() | |
line_limit -= 1 | |
current = 0 | |
k = 0 | |
smash_yogi(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment