Variables and Parameters are LocalΒΆ

For example, consider again the square function:

(bad_local)




(badsquare_1)

Although the badsquare function works, it is silly and poorly written.

(cl_powerof_bad)

A shadow means that the global variable cannot be accessed by Python because the local variable will be found first.

Analogously, look at the following.

(cl_change_parm)

Next Section - The Accumulator Pattern