-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirte22.py
41 lines (37 loc) · 1.07 KB
/
irte22.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
# Functions
# Functions are helpful for the DRY reason as it allows us to call a function which we defined witout writing it all over
pic = [
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1],
[0, 1, 1, 1, 1, 1, 0],
[0, 0, 1, 1, 1, 0, 0],
[0, 0, 0, 1, 0, 0, 0]
]
image = [
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 0, 0],
[0, 1, 1, 1, 1, 1, 0],
[1, 1, 1, 1, 1, 1, 1],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0]
]
def show_pic(): # defined a function to use it over and over without writing everything again
for i in pic:
for j in i:
if j == 1:
print("*", end='')
else:
print(' ', end='')
print('')
for row in image:
for column in row:
if (column == 1):
print('*', end='')
else:
print(' ', end='')
print('')
show_pic() # calling function
show_pic()
print(show_pic) # Prints memory alloted to this function