Created
February 4, 2016 19:06
-
-
Save mekhami/7e2da12fce078f63324f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Matrix(object): | |
| def __init__(self, width, height): | |
| self.width = width | |
| self.height = height | |
| self.matrix = [] | |
| for x in range(self.height): | |
| self.matrix.append(['.'*self.width]) | |
| def __str__(self): | |
| rows = [x for x in self.matrix] | |
| return '\n'.join([''.join([x for x in rows])]) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Traceback (most recent call last):
File "gameoflife.py", line 26, in
main_loop()
File "gameoflife.py", line 23, in main_loop
print(grid)
File "gameoflife.py", line 14, in str
return '\n'.join([''.join([x for x in rows])])
TypeError: sequence item 0: expected string, list found