Make sure to wrap your prompts with `int`


#1

Hi:

I am working on the Battleship lesson, but I have a problem. It says that we have to wrap our prompts with "int" and I use the example given, but it does not work.

Add your code below!

def guess_row(board):
return int(raw_input("Guess Row: "))

def guess_col(board):
return int(raw_input("Guess Col: "))

What I am missing?


#2

I think you have mixed up the lessons. Firstly, the raw_input is not used as a part of a function in the lessons. For lesson 8 : " ... and Seek ", it asked us to create a new variable guess_row and set it to int(raw_input("Guess row: ")) . Similarly, for guess_col

guess_row = int(raw_input("Guess Row: "))
guess_col = int(raw_input("Guess Col: "))


#3

Thanks Saeed2015. You were right. I was defining a function and I had to create a variable.

Thanks again for the help.