7/19 battleships please help


#1

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)

randomrow(board)
randomcol(board)

Thx


#2

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


#3

@dawidrz87

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

@12corkeryj

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

OR

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

#4

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


#5

@dawidrz87

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.


#6

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


#8

Didn't work out for me


#9

You need another ) after the - 1.


#10

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


#11

Thank you so much for helping