mirror of
https://github.com/satwikkansal/wtfpython
synced 2025-07-02 19:41:43 +02:00
Correct the snippet in Tic-tac-toe explanation
Fixes https://github.com/satwikkansal/wtfpython/issues/81
This commit is contained in:
parent
169fa2fb5e
commit
518881c70e
1 changed files with 1 additions and 1 deletions
2
README.md
vendored
2
README.md
vendored
|
@ -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', '', ''], ['', '', ''], ['', '', '']]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue