Error when no guess is entered


#1

So I'm just curios about the error I get when playing if I don't enter a number and just hit enter and a proper way to fix it.

Let's play Battleship!
O O O O O
O O O O O
O O O O O
O O O O O
O O O O O
Guess Row:
Traceback (most recent call last):
File "python", line 27, in
ValueError: invalid literal for int() with base 10: ''

The code works perfectly otherwise but this immediately ends the game if nothing is entered


#2

Check if the input is blank, if it is then make them re-guess.


#3

How would you do that?


#4

I would do it like this:

if (len(str(input)) == 0):