-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path43_2dLIsts.py
49 lines (33 loc) · 834 Bytes
/
43_2dLIsts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Day 43 on Replit: "Take Your List To A New Dimension"
# Fix my code section
# my2DList = ["Johnny", 21, "Mac"],
# ["Sian" 19, "PC"]
# ["Gethin", 17, "PC"], ]
# print(my2DList[0][1])
my2DList = [ ["Johnny", 21, "Mac"],
["Sian", 19, "PC"],
["Gethin", 17, "PC"], ]
print(my2DList[0][1])
# Challenge section
import random
print("Bingo Card Generator!")
print()
rows, cols = 3, 3
bingo = [[None for i in range(cols)] for j in range(rows)]
def prettyPrint():
for i in bingo:
print(i)
numbers = []
index = 0
for i in range(8):
ran = random.randint(1, 90)
numbers.append(ran)
numbers.sort()
for i in range(3):
for j in range(3):
if i == 1 and j == 1:
bingo[i][j] = "BINGO"
else:
bingo[i][j] = numbers[index]
index += 1
prettyPrint()