1,760
edits
Changes
→Part 2: Global Scope
: Python has one weird quirk when it comes to global scope: if you assign something to an existing object inside a function - it will assume you want to create a new object in that function's local scope. That will hide the global object inside the function unless you declare it explicitly with the global keyword:
: '''[https://ict.senecacollege.ca/~raymond.chan/ops435/labs/lab7/lab7i.py lab7i.py]''' - global keyword <source lang="python">
#!/usr/bin/env python3
# Student ID: [seneca_id]