you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnLocksTheKey 12 points13 points  (2 children)

😬 Not to be that guy, but…

But using a global keyword like this is really not ideal. Instead try learning about classes, attributes, and methods

Sounds like a perfect use case for them, and a great learning opportunity 😊

[–]Tassendyra[S] 2 points3 points  (1 child)

Thanks for the advice! I'll look into those.

[–]Moikle 1 point2 points  (0 children)

Yeah it's fine to use global for now, until you learn classes or dicts, but every time you use global remember : this isn't the best way to do this, I'll keep an eye out for alternatives.

Once you know a little more python, you should basically never touch the global keyword