Python: In Python, which comparison about LEGB Scope and Closures is accurate?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

In Python, which comparison about LEGB Scope and Closures is accurate?

  1. Closures capture names from an enclosing scope, while globals expose process-wide state and usually broaden coupling.
  2. There is no practical difference in behavior, performance, or maintainability when LEGB Scope and Closures is involved.
  3. The oldest option related to LEGB Scope and Closures is always the right production choice regardless of workload or context.
  4. Differences around LEGB Scope and Closures are mostly cosmetic, so correctness and debugging quality do not really change.

Hint

Focus on the behavior or tradeoff, not just the keyword.

Answer and rationale

Correct answer: A. Closures capture names from an enclosing scope, while globals expose process-wide state and usually broaden coupling.

Closures capture names from an enclosing scope, while globals expose process-wide state and usually broaden coupling. This is the comparison that usually separates memorization from understanding.

Track: Python