4 ms·
No it's not the same. The visibility of variable "foo" is extended beyond it's usefullness if you use `if`.
by heavenlyblue 5y ago
No it's not the same. The visibility of variable "foo" is extended beyond it's usefullness if you use `if`.
- pansa2 5y agoNo, the visibility of `foo` is the same in both examples. Python’s `if` statements do not introduce a new scope.