Skip to content

Instantly share code, notes, and snippets.

@shamikalashawn
Created February 6, 2017 22:54
Show Gist options
  • Save shamikalashawn/4a583c585f42ceb2fb92dc854f69d345 to your computer and use it in GitHub Desktop.
Save shamikalashawn/4a583c585f42ceb2fb92dc854f69d345 to your computer and use it in GitHub Desktop.
This function returns an upside down pyramid with the "*" character and a widest width of 5.
def inverted_pyramid():
pyramid = ''
pylength = [1,2,3,4,5]
for num in range(1):
for char in reversed(pylength):
pyramid = pyramid + '*' * char + '\n'
return pyramid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment