Skip to content

Commit 8cb95ad

Browse files
committed
Add ch05 lecture notes for SMU
1 parent e8290ca commit 8cb95ad

File tree

15 files changed

+52
-0
lines changed

15 files changed

+52
-0
lines changed

.DS_Store

2 KB
Binary file not shown.

2016_WV_CAU_Lecture_Slide/.DS_Store

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

2018_02_SMU_Lecture_Slide/.DS_Store

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
6 KB
Binary file not shown.
Binary file not shown.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Thu Jan 05 07:21:40 2017
4+
5+
@author: Yunho
6+
"""
7+
8+
# -*- coding: utf-8 -*-
9+
"""
10+
Created on Sat Dec 24 12:39:11 2016
11+
@author: Yunho
12+
"""
13+
import sys
14+
15+
#print sys.argv[0] # prints python_script.py
16+
#print sys.argv[1] # prints var1
17+
#print sys.argv[2] # prints var2
18+
print "ver 2.0"
19+
20+
21+
22+
def tree_maker(initial_num, increasing_tree, tree_space):
23+
shape = "*"
24+
space = " "
25+
space_num = initial_num
26+
initial_num = initial_num*2 -1
27+
print space * (2+tree_space - space_num) + shape * initial_num
28+
initial_num += increasing_tree
29+
print space * (1+tree_space - space_num) + shape * initial_num
30+
initial_num += increasing_tree
31+
print space * (0+tree_space - space_num) + shape * initial_num
32+
33+
def pot_maker():
34+
"""Draw pot
35+
36+
this is default function of tree"""
37+
pass
38+
39+
def main():
40+
"""This is main function
41+
42+
You can draw christmas tree using this module"""
43+
# help(tree_maker)
44+
# help(pot_maker)
45+
level_of_tree = int(sys.argv[1])
46+
tree_space = level_of_tree+5
47+
level_of_tree += 1
48+
for i in range(1,level_of_tree):
49+
tree_maker(i, 2, tree_space)
50+
51+
if __name__ == "__main__":
52+
main()
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)