1,234
edits
Changes
→LAB 7 SIGN-OFF (SHOW INSTRUCTOR)
Note that the function1() call does not modify the global '''authorName''' variable but function2() does.
As an exercise: modify the example above so that it would print the following, by changing only the scope of some variables. Save the program as '''lab7c.py''':
<source>
Andrew
Andrew 1
Andrew 1
Andrew 2
Andrew 1
</source>
== Object/Instance Scope ==
::<span style="color:green;font-size:1.5em;">✓</span> Output of: <code>./CheckLab7.py -f -v</code>
::<span style="color:green;font-size:1.5em;">✓</span> Output of: <code>cat lab7a.py lab7b.py lab7c.py</code>
= LAB REVIEW =