Oops, try again. Your choices are not random enough. Try running it again


Not sure if this is a bug. here is my code :

from random import randint  

board = [] 

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

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

def random row(board): 
    row = randint(1,len(board)-1) 
    return row 

def random col(board): 
    column = randint(1,len(board)-1) 
    return column 

random row(board) 
random col(board)


your board is 5 by 5, and lists are zero indexed based so the indexes are: 0, 1, 2, 3, 4

currently, you can't have row 0 or col 0 for your ship, which is why you get the error

next time please post your code with markup:


got it. Thank you!

Will be sure to use the proper markups next time, thank you again.