Glossary: Python Beyond the Basics
global
Also written: global keyword
A Python keyword placed inside a function that tells Python a name refers to a variable defined outside the function, so assigning to it changes that outer variable instead of creating a local one. It is usually better avoided, because functions that quietly change outside variables are hard to understand and test; passing values in and returning the new one is clearer.