Question

In Python, what will be the output of the following code snippet, considering scope rules? x = 5                  def func():     x = 10     def inner():         nonlocal x         x += 1         return x     return inner()   print(func())

A 6
B 11
C 10
D UnboundLocalError
E None
Practice Next

Hey! Ask a query