Skip to content

Ada-Activities/variables-and-memory-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Variables and Memory Samples

The various scope files show examples of different scopes

Real Python article: https://realpython.com/python-scope-legb-rule/

There are 4 scopes in python:

  • function (local)
  • enclosing
  • global
  • built-in

We only mention function and global in the reading. Additionally, python has no block scope, which can be useful to note for anyone who may have worked in a language that does have block scope.

Files Description
scope_00.py global and built-in
scope_01.py accessing global var from a function
scope_02.py optional; we can play around with errors brought on by trying to modify a
scope_03.py local function variables
scope_04.py shows enclosing scope (basically closure semantics)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages