```
class sheet:
    def __init__(self):
        def close_game():
            print("game closed")
        def click():
            eval("close_game()")

        click()

s1 = sheet()

```

I'm getting such error:

```
  File "<string>", line 6, in click
NameError: name 'close_game' is not defined

```

But if I replace 'eval("close\_game()")' with 'close\_game()' it works correctly. Please explain to me why it works like that.