Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Christopher Sullivan
Christopher Sullivan
4,230 Points

Why does my out put look like the following on this task?

treehouse:~/workspace$ python game.py                                                                                   
['   ', 'Boo', '   ', '   ']                                                                                            
['   ', 'Add', '   ', 'Boo']                                                                                            
['   ', 'Add', '   ', '   ']                                                                                            
['   ', '   ', '   ', '   ']   

My code:

  def create_grid(self):
        header = ' |  ' + '  |  '.join(self.columns) + '  |'
        print(header)
        for row in range(1, self.size + 1):
            print_row = f'{row}| '
            get_row = self.create_row(row)
            print_row += ' | '.join(get_row)
            print(print_row)
Steven Parker
Steven Parker
231,261 Points

This code is not complete, we need more information to replicate the issue. Take a look at this video about Posting a Question, and perhaps also this one about sharing a snapshot of your workspace.

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

Since header is not printing, perhaps the print output is coming from elsewhere in the code and the function create_grid is not executing. As Steven Parker said, more code is needed to debug.