5. Custom Print (dunno what row means)


#1


https://www.codecademy.com/en/courses/python-beginner-en-4XuFm/0/5?curriculum_id=4f89dab3d788890003000096#

I fetched this code from discussion. It works well but I am lost.


I get it until

board = []

for item in range(5):
board.append(["O"] * 5)

def print_board(board):

but I got lost from below and don't know what "row" does in this code.

for row in board:
    print(row)


board = []

for item in range(5):
    board.append(["O"] * 5)

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

print_board(board)

Thank you!


#2

It is a placeholder, really. If you replace "row" throughout your code with "x" it does the same thing.


#3

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