3. Local and Global VariablesΒΆ
Note: The scope of
a
in the example below is different in the two cases. In other words, the two variablesa
are different.
Activity: CodeLens 3.1 (cl_l20_3a_en)
In this case, we use the keyword global. So, the variable
a
inside the function is the same as the variable defined earlier, that is, it is the global variable.
Activity: CodeLens 3.2 (cl_l20_3b_en)
Observe the difference in the outputs in examples 9 and 10.
You have attempted of activities on this page