Skip to content

Instantly share code, notes, and snippets.

@CodeMaster7000
Created December 24, 2021 12:31
Show Gist options
  • Save CodeMaster7000/151fa19c4da3cea3df95d873a48260f2 to your computer and use it in GitHub Desktop.
Save CodeMaster7000/151fa19c4da3cea3df95d873a48260f2 to your computer and use it in GitHub Desktop.
A Christmas Tree made out of stars. Merry Christmas everyone!
def triangleShape(n):
for i in range(n):
for j in range(n-i):
print(' ', end=' ')
for k in range(2*i+1):
print('*',end=' ')
print()
def poleShape(n):
for i in range(n):
for j in range(n-1):
print(' ', end=' ')
print('* * *')
row = int(input('Enter number of rows: '))
triangleShape(row)
triangleShape(row)
poleShape(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment