Skip to content

Instantly share code, notes, and snippets.

@codeboy101
Created September 14, 2017 09:24
Show Gist options
  • Save codeboy101/b2784ecef7e66ee683fb6189df05ab67 to your computer and use it in GitHub Desktop.
Save codeboy101/b2784ecef7e66ee683fb6189df05ab67 to your computer and use it in GitHub Desktop.
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