-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmario.py
More file actions
74 lines (42 loc) · 989 Bytes
/
Copy pathmario.py
File metadata and controls
74 lines (42 loc) · 989 Bytes
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
## Abstractions
# ## Printing columns
# def main():
# print_column(3)
# def print_column(height):
# for _ in range(height):
# print("#\n" * height, end="")
# main()
# ## Printing in row
# def main():
# print_row(4)
# def print_row(width):
# print("?" * width)
# main()
# ## Another approach to above
# def main():
# print_square(3)
# def print_square(size):
# # For each row in square
# for i in range(size):
# # For each brick in row
# for j in range(size):
# # Print brick
# print("#", end="")
# print()
# main()
# ## A little more refined approach to code above
# def main():
# print_square(3)
# def print_square(size):
# for i in range(size):
# print("#" * size)
# main()
## Or another approach
def main():
print_square(3)
def print_square(size):
for i in range(size):
print_row(size)
def print_row(width):
print("#" * width)
main()