I could be incorrect on this but I noticed when I define a variable outside a function and to change the variable you need to use the key word ‘global’ but it does not seem to work…
code would look something like,
foo = "foo"
foo = "bla"
Edit: I found a way around what I needed, just made returns values to and from what I needed…
Ah yeah, it seems our Python parser, Filbert, doesn’t support the
global keyword yet. You can check which other slightly-more-advanced Python features are or aren’t yet included on Filbert’s readme: https://github.com/codecombat/filbert
Is there a solution to global variables in python yet? Or do we have to pass things back and forth?
This thread is over a year old. Try not to revive dead threads, but it’s always good to keep in check in case of updates
Sorry, I’m new. So you’re saying that it’s better to create a new thread asking the same question than to revive the most relevant thread?
"Ah yeah, it seems our Python parser, Filbert, doesn’t support the global keyword yet. "
Seems like pinging this same topic for context makes the most sense to me.
I suppose in this case it’s okay. For most topics you probably shouldn’t revive dead threads unless you have a related issue or something, but in cases like this it’s always a good idea to check.