Created
February 6, 2017 23:03
-
-
Save shamikalashawn/889108da820685a3682cfbf0532a3c7b to your computer and use it in GitHub Desktop.
A pyramid created from the "*" character is returned using nested for loops.
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 nested_pyramid(): | |
pyramid = '' | |
for num in range(1): | |
for char in range(1,6): | |
pyramid = pyramid + '*' * char + '\n' | |
return pyramid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is kind of cheating because the outer for loop just runs once.