Printing Pretty Help me out of this................![solved] by #stetim94 in #post1


board = []          #empty list
for i in range(0,5):
def print_board(board):
    for row in board:
        print "  ".join(row)        


this line:

print "  ".join(row)

there should be one space between the quotation marks ("), not two


Also better way to write:

        return " ".join(row)


So you returning to the function and printing the function output. It is a good practice :slight_smile:


except the whole purpose of the function is to print the board, and you will need it later, plus then it is better to use print. And, using return means only one row is printed, instead of all 5.

there are scenarios (like this one) where print simply is better then return


Yes you are right, especially this exercise does not finish until the last stage, so it is not finished yet and the whole game has lots of printing.


yes, which is why you have this function to do al the printing for you