Battleship! 3/19


#1

Not really sure what I'm doing, it asked for a 5x5 grid of upper-case O's, however my code won't pass for some reason. When I made 'board' a list with 5 lists and when each list had 5 O's that also didn't pass..? I guess I'm missing something but I'd love some help, thanks!

board = board_range(5)

def board_range(value):
board = [["O"] * value] * value

for item in board:
    print item
    print ""

print board


#2

Hola bueno a mi resulto bien así XD , te comparto el código

tablero=[]
for i in range(0,5):
lista=["O","O","O","O","O"]
tablero.append(lista)
print tablero

Saludos


#3

Why would you reply in spanish?


#4

This is the code I used:

board = []
for i in range(0,5):
    tiles = ["O"] * 5
    board.append(tiles)
print board

You will make it into a grid later :smile:

Hope this helps.

~NocturnalDweller~


#5

board = []
for i in range(5):
strings = ["O"] * 5
board.append(strings)
print board


#6

Probably because they speak spainish :slightly_smiling: