Skip to content

Files

Latest commit

 

History

History
27 lines (17 loc) · 501 Bytes

global-variable-not-assigned.md

File metadata and controls

27 lines (17 loc) · 501 Bytes

Pattern: Global variable is not assigned

Issue: -

Description

Used when a variable is defined through the global statement but no assignment to this variable is done.

Example of incorrect code:

def func():
    global name

Example of correct code:

def func():
    global name
    mouse = "modified"

Further Reading