Assessment --- Scoping in Python

Oct 1, 2014 • Anja Boskovic

This is both my favourite type of Python question and a multiple choice. I will add another favourite type later:

`
def name (x, y):
  y = x + 2
  x = 3
  return y</p>

x = 2
y = 3
a = name(y, x)
b = x
` What is the value of a? a. 2 b. 3 c. 4 d. 5 What is the value of b? a. 2 b. 3 c. 4 d. 5