7/19 battleships please help


I'm sure i've done the code 100% correctly but its says did you create a function called random row.please help.

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)

# Add your code below!

def randomrow(board):
    return randint(0, len(board) - 1)
def randomcol(board):
    return randint(0, len(board) -1)




Try with naming functions random_row and random_col instead of randomrow and randomcol.



It will not show the _ because it is not formatted correctly for the forums.


Highlight your code and press ctrl + alt + c or hit the </> key above the entry area.


# code here
``` # end ---Omit the end part


@zeziba are you sure about that because here underline is visible



Yup, it's because of how the html and javascript are running the entries we put in. That is why it is important to properly format your code.


Everything is fine up there , just be sure to include underscores in function names and when calling them.
Lekker my broe: :+1:


Didn't work out for me


You need another ) after the - 1.


I Thank you for your guidance and resolving this problem. :grinning:


Thank you so much for helping