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

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)