What is the output of the following code ?
def foo(): var += 3 return var var = 12 print(foo())
The value global variable can not be changed without explicitly specifying with global keyword.So the following code will print 15
def foo(): global var var += 3 return var var = 12 print(foo())
Comment here: