1 write the function makegrid this function


1. Write the function makegrid. This function accepts a width and height and creates a grid/matrix of cells. The width gives the number of columns and the height the number of rows of the grid that should be created.

e.g. >>> makegrid(4,5)

[('cell', (0, 0), ['t', 'b', 'r', 'l']), ('cell', (0, 1),['t', 'b', 'r', 'l']), ('cell', (0, 2), ['t', 'b', 'r', 'l']),

('cell', (0, 3), ['t', 'b', 'r', 'l']), ('cell', (0, 4), ['t','b', 'r', 'l']), ('cell', (1, 0),['t', 'b', 'r', 'l']),

('cell', (1, 1), ['t', 'b', 'r', 'l']), ('cell', (1, 2), ['t','b', 'r', 'l']), ('cell',(1, 3), ['t', 'b', 'r', 'l']),

('cell', (1, 4), ['t', 'b', 'r', 'l']), ('cell', (2, 0), ['t','b', 'r', 'l']), ('cell', (2, 1), ['t', 'b', 'r', 'l']),

('cell', (2, 2), ['t', 'b', 'r', 'l']), ('cell', (2, 3), ['t','b','r', 'l']), ('cell', (2, 4), ['t', 'b', 'r', 'l']),

('cell', (3, 0), ['t', 'b', 'r', 'l']), ('cell', (3, 1),['t','b', 'r', 'l']), ('cell', (3, 2), ['t', 'b', 'r', 'l']),

('cell', (3, 3), ['t', 'b', 'r', 'l']), ('cell',(3, 4), ['t','b', 'r', 'l'])]

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: 1 write the function makegrid this function
Reference No:- TGS0208404

Expected delivery within 24 Hours