Created
February 6, 2017 22:54
-
-
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.
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
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