forked from Saber307/Python-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChristmas_tree.py
More file actions
38 lines (31 loc) · 777 Bytes
/
Christmas_tree.py
File metadata and controls
38 lines (31 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Christmas Tree Program
# Description: This program will print a Christmas tree
# Author: PunGrumpy
def init():
step = 5
start = 0
leaves = 4
space = leaves * 4
stem = leaves
height = 1
# Leaf
for xmas in range(1, leaves + 1):
for i in range(start, step + 1):
for j in range(space, i, -1):
print(" ", end="")
for k in range(1, i + 1):
print("* ", end="")
print()
start += 3
step += 3
# Stem
for i in range(0, stem + height):
for j in range(0, stem + 1):
print(" ", end="")
for k in range(0, stem):
print(" * ", end="")
print()
def main():
init()
if __name__ == "__main__":
main()