Skip to content

Instantly share code, notes, and snippets.

@Hydrotoast
Created December 14, 2012 04:22
Show Gist options
  • Save Hydrotoast/4282680 to your computer and use it in GitHub Desktop.
Save Hydrotoast/4282680 to your computer and use it in GitHub Desktop.
Creates a simple christmas tree.
def CreateTree(half_width):
for i in range(half_width):
print(' ' * (half_width - i), '*' * (2 * i - 1))
for i in range(half_width >> 2):
print(' ' * (half_width - 1), '+')
# CreateTree(6)
# *
# ***
# *****
# *******
# *********
# +
# +
# +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment