5. Custom Print - Getting a Hex value when submitting code


#1



When doing "Custom print", my code passes, but kicks out a hex value: ' <function print_board at 0x7fb3a04eb93 ' Any idea what I'm doing wrong?


board = []

for x in range(0,5):
    board.append(['O','O','O','O','O'])
def print_board(board):
    for row in board:
        print row
print print_board.


#2

That statement is not a call to the function, but instead prints the binding address of the function in memory.

Recall that your function is already printing, so just call it.

print_board(board)

We need the () to invoke the function. The board object is passed in as the argument.


#3

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