Beginner Python
Q32 / 101

What does global keyword do in Python?

Correct! Well done.

Incorrect.

The correct answer is B) Declares that a variable inside a function refers to the module-level variable

B

Correct Answer

Declares that a variable inside a function refers to the module-level variable

Explanation

Without global x, assigning x = value inside a function creates a local variable. global x tells Python to use the module-level x.

Progress
32/101