Changes

Jump to: navigation, search

OPS435 Python Lab 7

No change in size, 19:04, 3 December 2017
Global Scope
</source>
Note that the same thing is printed over and over because the '''authorName''' variable is defined outside a function which makes it global which makes it accessible from whywhereanywhere.
Python has one weird quirk when it comes to global scope: if you assign something to a variable inside a function - it will assume you want to create a new variable in that function's local scope. That will hide the global variable inside the function unless you declare it explicitly as global:
198
edits

Navigation menu