1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-12-22 21:00:09 +01:00

Correct the snippet in Tic-tac-toe explanation

Fixes https://github.com/satwikkansal/wtfpython/issues/81
This commit is contained in:
Satwik Kansal 2018-05-23 18:13:50 +05:30
parent 169fa2fb5e
commit 518881c70e

2
README.md vendored
View File

@ -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', '', ''], ['', '', ''], ['', '', '']]