Python, Python Programming, Coding, Web Developer, Code.
out the value of x in its local namespace (which is 2), but when we print out the value of x outside of foo, we see that it still has a value of 1. This is because foo created a new local variable x rather than modifying the global variable. When we call bar, it modifies the global variable x to