Comprehensions are having some unexpected interactions with scoping. Is this the expected behavior?
I\'ve got a method:
def leave_room(self, uid):
In python3 while in list comprehension the variable is not getting change after it's scope over but when we use simple for-loop the variable is getting reassigned out of scope.
i = 1 print(i) print([i in range(5)]) print(i) Value of i will remain 1 only.
Now just use simply for loop the value of i will be reassigned.