Skip to content

Commit d9753e0

Browse files
committed
Add helper function to print header
1 parent 3ac6cee commit d9753e0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# ------------------------------------------------------------------------
2+
# Helper file for 100 Days of Code
3+
#
4+
# My first 'libaray' code
5+
#
6+
# Brent Gawryluik
7+
# 2018-07-09
8+
# ------------------------------------------------------------------------
9+
10+
11+
def print_header(title):
12+
13+
border_length = len(title) + 12
14+
15+
print()
16+
print_border(border_length)
17+
print_title(title)
18+
print_border(border_length)
19+
print()
20+
21+
def print_border(length):
22+
for _ in range(length):
23+
print('-', end='', flush=True)
24+
25+
print()
26+
27+
28+
def print_title(title):
29+
print(' ', end='', flush=True)
30+
print(title)

0 commit comments

Comments
 (0)