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

Commit 1b5fc8c

Browse files
committed
Update
1 parent 50278d3 commit 1b5fc8c

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

lessons/python/exercises/exercise-general-week-08-012--03.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424

2525
print("Filter some data: ",N[N > 200])
2626

27+
2728
print("Filter some data: ",N[N <100])
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
D = [
2+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
3+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
4+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
5+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
6+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
7+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
8+
[0, 0, 0, 0, 0, 0, 0, 0, 0],
9+
]
10+
11+
12+
L = [6, 6, 6, 6, 6, 6, 6, 6, 6]
13+
14+
15+
X = {
16+
0: '-',
17+
1: '@',
18+
2: '#',
19+
}
20+
21+
22+
def show():
23+
for row in D:
24+
for cell in row:
25+
print(X[cell], end="")
26+
print()
27+
28+
29+
show()
30+
31+
p1, p2 = 1, 2
32+
33+
while True:
34+
i = int(input(f"Enter 1-9: "))
35+
if i >= 1 and i <= 9:
36+
D[L[i-1]][i-1] = p1
37+
L[i-1] -= 1
38+
p1, p2 = p2, p1
39+
show()

0 commit comments

Comments
 (0)