Printing Pretty (6)


#1


I'm not stuck but I'm curious because this code passed but didn't print anything other than "None". Why is that?


board = []

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

def print_board(board):
    for row in board:
        print " ".join(row)


#2

in order for a function to execute, you need to call it


#3

I don't understand what you mean by "call it" (No offence)


#4

I'm now on lesson Hide... can you help me?

Here is my code:

import randint
board.append(["O"] * 5)
def print_board(x):
    
    for row in x:
        
        print (" ".join(row))

def random_row(x):
    return randint(0 , len(x) - 1)
def random_col(x):
    return randint(0 , len(x) - 1)

def random_row(x):
    return randint(0 , len(x) - 1)
def random_col(x):
    return randint(0 , len(x) - 1)

#5

this exercise explains function calls.

That is a further exercise, please make a new topic


#6

'Kay I will make a new topic :slight_smile:


#7

#8

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