7. ...and Seek!


#1

I am having an issue with syntax on the last line apparently and cant find the issue. I feel like it is identical to every other variable I have made before but apparently it isnt any help would be appreciated.

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):
    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)

# Add your code below!
guess_row = int(raw_input("Guess Row: ")
guess_col = int(raw_input("Guess Col: ")

#2

Hi @methodsurfer47887,
You are missing closing parenthesis for the call to int function. Last lines should look something like:

guess_row = int(raw_input("Guess Row: ")) # inserted )

#3

Oh my goodness thank you so much I feel so silly now.


#4

I have a question, what function did int had cuz I completely forgot ? and can you give me some example with it


#5

@microsolver81105 Consult the docs when in doubt - https://docs.python.org/2/library/functions.html#int


#6

what do u type once you save and submit