Skip to content

Commit b6b44dc

Browse files
committed
Final Commit
1 parent 1e6cf80 commit b6b44dc

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

Diff for: __pycache__/ex13.cpython-310.pyc

456 Bytes
Binary file not shown.

Diff for: ex13.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def frame_it(wordlist):
2+
longest = max(wordlist, key=len)
3+
llength = len(longest)
4+
print((llength+4)* '*')
5+
6+
for word in wordlist:
7+
if len(word) < llength:
8+
print('* ' + word + (llength - len(word)) * ' '+' *')
9+
else:
10+
print('* ' + word + ' *')
11+
12+
print((len(longest) + 4) * '*')

Diff for: main.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from ex10 import calculator
33
from ex11 import diagonal_printer
44
from ex12 import word_histogram
5+
from ex13 import frame_it
56
from ex2 import array_to_string
67

78
# ex1
@@ -72,4 +73,9 @@
7273

7374
# ex12
7475

75-
word_histogram("three three three two two one")
76+
# word_histogram("three three three two two one")
77+
78+
# ex13
79+
80+
wordlist = ["Hello", "World", "in", "a", "frame"]
81+
frame_it(wordlist)

0 commit comments

Comments
 (0)