Week 10 - Xmas tree sample program

posted Dec 16, 2016, 8:03 AM by Attila Lengyel

def xmastree(layer, stop):
  stars = 1
  for x in range(1,stop):
    print(" " * (layer - 1 - x) + "*" * stars)
    stars = stars + 2
    

height = 7

for y in range(3, height): 
  xmastree(height,y)
  



Comments