Skip to content

fix: remove unnecessary global statement in Hangman-Game.py #1632

Description

@ashrion

Summary

Hangman-Game.py declares 13 variables as global at the top of main(), but none are used outside the function. The comment even notes they are "not strictly necessary". This is unnecessary and makes the code harder to read.

Fix

Removed the global statement since all variables are local to main().

How to Test

  1. Run python games/Hangman-Game/Hangman-Game.py
  2. Play a round to verify the game works correctly
  3. Confirm no NameError or behavior changes

GSSoC 2026

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions