Попова Полина Дмитриевна, 441/2 группа DrawSquare 5232 | Костычев Александр Михайлович, 420 DrawSquare 4933 | ||||
---|---|---|---|---|---|
t | 1 | def squares(w, h, *scale): | t | 1 | def squares(w, h, *args): |
2 | a = [['.'] * w for i in range(h)] | 2 | ans = [['.'] * w for _ in range(h)] | ||
3 | for x, y, s, c in scale: | 3 | for X, Y, s, c in args: | ||
4 | for i in range(y, y + s): | 4 | for x in range(X, X + s): | ||
5 | for j in range(x, x + s): | 5 | for y in range(Y, Y + s): | ||
6 | a[i][j] = c | 6 | ans[y][x] = c | ||
7 | for i in a: | 7 | for row in ans: | ||
8 | print(''.join(i)) | 8 | print(''.join(row)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|