Today's exercise is about studying some edge cases in Python. Very simple actually:
Without running the code, what will be the code of the following:
Printing tuples
In Python 2:
a = (0)
print a
print (a)
print ((a))
print (((a)))
print (a, a)
print ((a, a))
In Python 3:
from __future__ import print_function # if you are running on Py2
a = (0)
print a
print (a)
print ((a))
print (((a)))
print (a, a)
print ((a, a))
Accessing globals
a = 5
def f(): print(a)
def g():
a += 1
print(a)
f()
g()
Write down your answers on a paper, then run the code and compare your results. Play with it for a while until you figure out why it behaves that way.
You can use this topic to ask questions if anything's unclear.