Home > other >  Novice inquired, "python programming quick-and-dirty -- let tedious work automation", 4.10
Novice inquired, "python programming quick-and-dirty -- let tedious work automation", 4.10

Time:10-11

Practice teaching material learned here, character figure grid, can output the desired results, but it is always more output line, (multiple output.), please, help to see,
 def common (grid) : 
For y in range (len (grid [0])) :
For x in the range (len (grid) - 1) :
Print (grid [x] [y], end=' ')
Print (grid [1] [y])
Print (grid [x] [y])

The 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', '. ', '. ', '. '],
[', '. ', '. ', '. ', '. ', '. ']]
Common (grid)


Output the following results:
.. Oo, oo.. 
. Ooooooo.
. Ooooooo.
. Ooooo..
. Ooo...
. o....
. # here multiple output line
  • Related