Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Commit fdd587b

Browse files
committed
Update
1 parent a0416d3 commit fdd587b

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

README-PYTHON-HOMEWORKS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
- Solve 2 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--02.py))
101101
- Solve 3 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--03.py))
102102
- Solve 4 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--04.py))
103-
- Solve 5 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--04.py))
103+
- Solve 5 ([**link**](/lessons/python/exercises/exercise-general-week-08-012--05.py))
104104
</details>
105105

106106

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from tkinter import *
2+
3+
win = Tk()
4+
canvas = Canvas(win)
5+
canvas.pack()
6+
7+
D = {
8+
1: {"name": "Name1", "last": "Last Name1"},
9+
2: {"name": "Name2", "last": "Last Name2"},
10+
3: {"name": "Name3", "last": "Last Name3"},
11+
4: {"name": "Name4", "last": "Last Name4"},
12+
}
13+
14+
t, o, size = 10, 40, 200
15+
for i in D.keys():
16+
# ----------------------------------------------------
17+
top = t+(o*(i-1))
18+
btm = top+o
19+
o2 = o/2
20+
# ----------------------------------------------------
21+
canvas.create_line(0, top, size, top)
22+
canvas.create_line(0, btm, size, btm)
23+
canvas.create_line(size, btm, size+o2, top+o2)
24+
canvas.create_line(size+o2, top+o2, size+1000, top+o2)
25+
canvas.create_line(size+o2, top+o2, size, top)
26+
# ----------------------------------------------------
27+
canvas.create_text(10, top+o/2, text=i)
28+
canvas.create_text(40, top+o/2, text=D[i]["name"])
29+
canvas.create_text(120, top+o/2, text=D[i]["last"])
30+
# ----------------------------------------------------
31+
32+
win.mainloop()

0 commit comments

Comments
 (0)