12 bad aim


#1

My code should be working but it keeps saying oops check that it outputs oops that's not in the ocean
1st picture shows the code and the 2nd picture shows the error but I don't know where I have gone wrong


(0, len(board) - 1) 12/19 and 13/19
#2

line 32 print "Oops, that's not even in the ocean."
looks like you forgot the comma and period
That's what fixed it on mine


#3

there is mine, yours help me for the end

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)

print_board(board)

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

def random_col(board):
    return randint(0, len(board[0]) - 1)

ship_row = random_row(board)
ship_col = random_col(board)
print ship_row
print ship_col
guess_row = int(raw_input("Guess Row:"))
guess_col = int(raw_input("Guess Col:"))



# Write your code below!
if guess_row == ship_row and guess_col == ship_col:
    "Congratulations! You sank my battleship"
else:
    
    if guess_col not in range(len(board)+1) \
    or guess_row not in range(len(board)+1):
        print "Oops, that's not even in the ocean."
    else:
        print "You misses my battleship!"
        board[guess_row-1][guess_col-1]= "X"
        print_board(board)