Custom Print


I was just wondering why the code works with only print and not return

def print_board(board):
    for row in board:
        print row


def print_board(board):
    for row in board:
        return row

why do I get an error while using return?


Hi @digitalsurfer96512,

The instructions include ...

Inside the function, write a for loop to iterates through each row in board and print it to the screen.

Although you can write the function to return the result, it is contrary to that instruction, which stipulates that the function print it instead.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.