Apr-22-2017, 02:03 AM
I am practicing with lists and can't figure out this logic... Could someone show me the way to the light :P. Here is what I want to do:
Copy the grid value and write code that uses it to print the image in an upright facing heart...
I know that it's going to use a loop inside a loop in order to print grid[0][0], then grid[1][0], then grid[2][0], and so on up to grid[8][0]. Which will finish the first row, so then print a new line. Then the program should print grid[0][1], then grid[1][1], then grid[2][1], and so on. The last thing it should print would be grid[8][5]. Passing the 'end' keyword argument to print() to avoid newlines printed automatically after each print() call.
Here is the grid:
Copy the grid value and write code that uses it to print the image in an upright facing heart...
I know that it's going to use a loop inside a loop in order to print grid[0][0], then grid[1][0], then grid[2][0], and so on up to grid[8][0]. Which will finish the first row, so then print a new line. Then the program should print grid[0][1], then grid[1][1], then grid[2][1], and so on. The last thing it should print would be grid[8][5]. Passing the 'end' keyword argument to print() to avoid newlines printed automatically after each print() call.
Here is the grid:
grid = [['.','.','.','.','.','.'], ['.','O','O','.','.','.'], ['O','O','O','O','.','.'], ['O','O','O','O','O','.'], ['.','O','O','O','O','O'], ['O','O','O','O','O','.'], ['O','O','O','O','.','.'], ['.','O','O','.','.','.'], ['.','.','.','.','.','.']]