Example 3 FIG Python character grid

        Given a list of lists, each list is the value of the inner layer contains a character string, such as:

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', '. ','. ','. '], 
        ['. ','. ','. ','. ','.', '.']]

  You can think of grid [x] [y] is a "map" in the x, y coordinates of the character, the figure by the text characters. Origin (0, 0) in the upper left, to the right to increase the x coordinate, y coordinate increases downward.

       Copying the front grid values, writing code which print an image.

..OO.OO .. 
.OOOOOOO. 
.OOOOOOO. 
..OOOOO .. 
... OOO ... 
.... O ....

 

Guess you like

Origin www.cnblogs.com/wlinuxtop/p/11628479.html