.. _global-variable-not-assigned: global-variable-not-assigned / W0602 ==================================== **Message emitted:** ``Using global for %r but no assignment is done`` **Description:** *When a variable defined in the global scope is modified in an inner scope, the 'global' keyword is required in the inner scope only if there is an assignment operation done in the inner scope.* **Problematic code:** .. literalinclude:: /data/messages/g/global-variable-not-assigned/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/g/global-variable-not-assigned/good.py :language: python Created by the `variables `__ checker.