Skip to content

Instantly share code, notes, and snippets.

@shamikalashawn
Created February 6, 2017 23:03
Show Gist options
  • Save shamikalashawn/889108da820685a3682cfbf0532a3c7b to your computer and use it in GitHub Desktop.
Save shamikalashawn/889108da820685a3682cfbf0532a3c7b to your computer and use it in GitHub Desktop.
A pyramid created from the "*" character is returned using nested for loops.
def nested_pyramid():
pyramid = ''
for num in range(1):
for char in range(1,6):
pyramid = pyramid + '*' * char + '\n'
return pyramid
@shamikalashawn
Copy link
Author

This is kind of cheating because the outer for loop just runs once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment