Skip to content

Instantly share code, notes, and snippets.

@maxfire2008
Last active December 21, 2021 02:01
Show Gist options
  • Save maxfire2008/5f5a8351bbfa33c596c9601777a3d55b to your computer and use it in GitHub Desktop.
Save maxfire2008/5f5a8351bbfa33c596c9601777a3d55b to your computer and use it in GitHub Desktop.
pyramid generator
import random
def leftside(o,c):
if type(o) == str:
o = [o]
for x in range(c):
print(random.choice(o)*(x+1))
def centered(o,c,sc,ditchright=True):
if type(o) == str:
o = [o]
maxlength = c
for x in range(c):
genright = ""
if not ditchright:
genright = (sc*(maxlength-(x+1)))
print((sc*(maxlength-(x+1)))+(random.choice(o)*((x+1)*2))+genright)
print("""Try using 5 spaces for Discord""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment