-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04.py
34 lines (27 loc) · 841 Bytes
/
04.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
spam = ['apples', 'bananas', 'tofu', 'cats', 1]
def func(someList: list):
str1 = ''
someList[-1] = 'and ' + str(someList[-1])
for num in range( len(someList) ):
str1 = str1 + str(someList[num])
if someList[num] != someList[-1]:
str1 += ','
print(str1)
func(spam)
grid = [
['.', '.', '.', '.', '.', '.'],
['.', 'O', 'O', '.', '.', '.'],
['O', 'O', 'O', 'O', '.', '.'],
['O', 'O', 'O', 'O', 'O', '.'],
['.', 'O', 'O', 'O', 'O', 'O'],
['O', 'O', 'O', 'O', 'O', '.'],
['O', 'O', 'O', 'O', '.', '.'],
['.', 'O', 'O', '.', '.', '.'],
['.', '.', '.', '.', '.', '.']]
h = len(grid)
l = len(grid[0])
print(len(grid), h, l)
for y in range(l):
for x in range(h-1, -1, -1):
print(grid[x][y], end='')
print('')