0

What are 2D grids?

2/12/2016 2:45:00 AM

Obadina Tobiloba

2 Answers

New Answer

+1

Do you mean M = [[0,1,2], [3,4,5], [6,7,8]]? M is a list with 3 entries, each of which is a list of 3 entries. M[1][1] is 4. So M acts like a 2D grid, or a 3x3 matrix.

+1

imagine you need to draw a point in t screen. for that you need coordinates, such as values for X horizontal axis and Y vertical axis. to draw only one point you will need only 2 values, or a single list. But if you need several points with different coordinates you cant represent them with just a single list. So there you make a loat inside a list, one for each axis. this way you represent a 2D grid