Changes

Jump to: navigation, search

OPS435 Python3 Lab 7

71 bytes added, 20:47, 3 November 2019
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]
1,760
edits

Navigation menu