Scope in Python: The Crash Course

A Straightforward Guide to Scope In Python for Coders On The Go

Photo by frank mckenna on Unsplash

What is scope?

In Python, scope is the context in which a variable is defined, and this context determines how a variable can be used throughout the code.

There are three areas where you can define a variable:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jon McEwen

Helping job-seekers, data analysts, and data engineers skill-up the easy way. Instagram: https://www.instagram.com/datawithjon/