CSC111 Exercises with Global Variables
--D. Thiebaut (talk) 15:57, 24 April 2014 (EDT)
Predict the output of the following programs, of if they crash, indicate why.
Exercise1
A = 3
def f1( x ):
print( "f1", x, A )
print( "A = ", A )
f1( 30 )
Exercise2
def f1( x ):
print( "f1", x, A )
f1( 30 )
print( "A = ", A )