Hide


#1



Help please :rage:

https://www.codecademy.com/courses/python-beginner-en-4XuFm/0/7?curriculum_id=4f89dab3d788890003000096
I'm kinda stuck :anchor:

Error:
Oops, try again. Make sure not to delete or modify the board!


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)


Printing Pretty (6)
#2

Heeelllllppppppppppppppppppppppppp Please :frowning:


#3

Hi @th3b33,

I copy/pasted your code into the exercise. In the terminal window it gave me this error:

That error message is telling you that there is a problem on line 1. It is also telling you what is causing the problem.

I would suggest you have a look over the explanation given in the exercise and try to fix this problem. Once you do that then we can look at any other error messages that you see.


#4

Yeah, that's the import line but I don't know what to change.


#5

from random 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)

then it tells me I have an error on line 2


#6

I figured it out ! THANKS!!!!!


#7

You are missing the board = [] function. That is why you are getting one of the errors.


#8

I know, I just said I figured it out :slight_smile: (no offense) Thanks anyways :slight_smile: :grin:


#11