Skip to content

Instantly share code, notes, and snippets.

@FernandoCelmer
Last active March 28, 2023 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoCelmer/c3d64cccabe211ba87f0472df4242bd5 to your computer and use it in GitHub Desktop.
Save FernandoCelmer/c3d64cccabe211ba87f0472df4242bd5 to your computer and use it in GitHub Desktop.
def pyramid(scale: int):
node = []
for index in range(1, scale + 1):
node.append((index*2-scale)*"*") if (index*2-scale) > 0 else None
for item in node:
print(item.center(scale))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment