Re: error i m getting in line no 4

2017-05-29 Thread woooee
And you can simplify the code with something like this for all of the "grid=" statements new_grid = [[], [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0], [2,0,2,0],[0,4,0,8],[0,16,0,128],[2,2,2,2], [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]], [2,0,2,0],[0,4,0,8

Re: error i m getting in line no 4

2017-05-29 Thread Chris Angelico
On Tue, May 30, 2017 at 2:36 AM, Mohd Gausul Abdeen wrote: > import util > > def run_test (test): > if test == 0: > grid = [] > util.create_grid (grid) Is this your actual code, or did you lose formatting when you posted it? Either way, make sure you retain indentation in Python code. Also, you

error i m getting in line no 4

2017-05-29 Thread Mohd Gausul Abdeen
import util def run_test (test): if test == 0: grid = [] util.create_grid (grid) print (len (grid)) print (len (grid[0])) print (len (grid[1])) print (len (grid[2])) print (len (grid[3])) print (grid[0][0]) print (grid[1][2]) print (grid[2][1]) print (grid[3][3]) elif test == 1: grid = [[0,0,0,0],