Skip to content
Permalink
Browse files

Correct the snippet in Tic-tac-toe explanation

Fixes #81
  • Loading branch information...
satwikkansal committed May 23, 2018
1 parent 169fa2f commit 518881c70e18a304ec03e0bf7d7ca99154371272
Showing with 1 addition and 1 deletion.
  1. +1 −1 README.md
@@ -530,7 +530,7 @@ And when the `board` is initialized by multiplying the `row`, this is what happe
We can avoid this scenario here by not using `row` variable to generate `board`. (Asked in [this](https://github.com/satwikkansal/wtfpython/issues/68) issue).

```py
>>> board = [(['']*3)*3] # board = = [['']*3 for _ in range(3)]
>>> board = [['']*3 for _ in range(3)]
>>> board[0][0] = "X"
>>> board
[['X', '', ''], ['', '', ''], ['', '', '']]

0 comments on commit 518881c

Please sign in to comment.
You can’t perform that action at this time.