Because scope_test already has local variable name spam.
scope looks up local spam first. If not exist then looks for global spam.
scope looks up local spam first. If not exist then looks for global spam.
spam = "global" def global_spam(): print(spam) def local_spam(): spam = "local" print(spam) local_spam() global_spam()
99 percent of computer problems exists between chair and keyboard.