mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-24 12:04:24 +01:00
A minor grammar correction
This commit is contained in:
parent
de113d2491
commit
8370f3a3b9
2
README.md
vendored
2
README.md
vendored
@ -1023,7 +1023,7 @@ Even when the values of `x` were different in every iteration prior to appending
|
||||
|
||||
- When defining a function inside a loop that uses the loop variable in its body, the loop function's closure is bound to the variable, not its value. So all of the functions use the latest value assigned to the variable for computation.
|
||||
|
||||
- To get the desired behavior you can pass in the loop variable as a named variable to the function. **Why this works?** Because this will define the variable again within the function's scope.
|
||||
- To get the desired behavior you can pass in the loop variable as a named variable to the function. **Why does this work?** Because this will define the variable again within the function's scope.
|
||||
|
||||
```py
|
||||
funcs = []
|
||||
|
Loading…
Reference in New Issue
Block a user