Коляскина Ирина Сергеевна 524 DrawSquare 5582 | Вакуленко Георгий Константинович, 321 группа DrawSquare 5096 | ||||
---|---|---|---|---|---|
t | 1 | def squares(w, h, *sqs): | t | 1 | def squares(n, m, *tuples): |
2 | p = [['.' for _ in range(w)] for _ in range(h)] | 2 | mas = [['.' for i in range(n)] for i in range(m)] | ||
3 | for sq in sqs: | 3 | for tup in tuples: | ||
4 | x, y, s, c = sq | 4 | y, x, l, fig = tup | ||
5 | for i in range(s): | 5 | for i in range(l): | ||
6 | for j in range(s): | 6 | for j in range(l): | ||
7 | p[y + i][x + j] = c | 7 | mas[x + i][y + j] = fig | ||
8 | for row in p: | 8 | for row in mas: | ||
9 | print(''.join(row)) | 9 | print(''.join(row)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|