How to avoid globals (and use classes)?
问题 To have some exercise in learning Python, and especially with Object orientated programming. I'm creating a simple text based game. I'm a bit struggling with the use of global variables. People say it's better to avoid them. My question how can I make thing work without them and where to declare those variables. Currently in my main() method I'll start the game based on Classes for every room or interaction that can happen in the game. But there are some objects I want to access anytime, like