Not Again!


The UI keeps telling me "Oops, try again.Did you remember to add the "You guessed that one already" message to your elif statement?"

I expect the code to let me continue to the next exercise even after I debugged by setting coordinates (0,1) to equal X so I could test the statement.

Pardon the rude language in the print statements, I was just trying to have my own fun with them.

from random import randint

board = []

for i in range(0,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)

print ship_row
print ship_col

board[0][1] = 'X'

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

# Write your code below!
if guess_col not in range(5) or guess_row not in range(5):
    print "You think you can wage war on space?!"
elif guess_row == ship_row and guess_col == ship_col:
    board[guess_row][guess_col] = 'Y'
    print "Fuck you, you son of a bitch! I'll kill your parents!"
elif board[guess_row][guess_col] == 'X':
        print "You guessed that one already"
    board[guess_row][guess_col] = 'X'
    print "You dare fire upon my war vessel?!"


strings printed need to be an exact match, copy paste them from the instructions

don't use additional print statement, it might trick error messages


I figured out the problem....I forgot the period at the end of the print statement.