Printing pretty


#1

i'm getting the same error message as ajaxrunner15120
as far as i can see the code looks correct, and i tried it in firefox as well. could there be something wrong with the terminal?

board = []
 
for x in range(5):
    board.append(["O"] * 5)
    
def print_board(board):
    for row in board:
        print "  ".join(row)
        
print_board(board)

any help would be greatly appreciated.


Need Help!
#2

you join the list with two spaces instead of one:

`"_".jon() vs "__".join()

i replaced the spaces with underscores so you can see it, you should have one space, not two


#3

thanks stetim, i've tried with no spaces, one space, and two spaces still with no joy. does the code work on yours? it prints fine

it works in my 2.7 shell.


#4

can you copy paste your code to the forum so i can run it?


#5

Here you go,

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

thanks for the help. the formatting looks a bit off when i send it through. but it looks like the screen capture i left earlier


#6

your code works fine, try refreshing the page/different browser. The enviroment keeps running, so sometimes sense cached data


#7

just tried it on edge, fire fox, and chrome. I reset the code, and rewrote/pasted refreshed after writing. still no joy. i noticed the terminal can be a bit funny on the PHP tutorial sometimes. but when i refresh the page the code works on PHP.


#8

That is weird, i don't have problems with your code..


#9

I tried to run the same code as joecageaogooglemail. It didn't work. And somehow, this is what I ended up with purely by accident. This works fine but I have no idea how this is working. Can someone explain what is going on?


#10

i think you tricked the checking script, but it is impossible to do this for all exercises to come


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.