5/13 custom print try another way but fail. want to know why



Traceback (most recent call last):
File "python", line 12, in
File "python", line 9, in print_board
TypeError: 'int' object is not iterable

I just want to try using the "for a in len(x), print board[a]" as following, printing the index of the list, instead of using just print the item. But, as you see, I fail.

I just wander why. What is the problem with my code?

Thank you!

board = []

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

def print_board (x):
    for a in len(x):
        print board[a]



To make a an integer, work with a range()...

    for a in range(len(x)):