Still a pretty new user here, but getting more and more comfortable with Python. Just a question about when/where variables should be assigned. I remember from high school Java that in many cases, variables could be assigned at the beginning of the code but as I continue to learn Python, it seems more common that variables are assigned as you use them (ie. instead of in a single block at the beginning, they come in the middle of code as they’re needed, in if blocks, etc.)
Is there a “right” way to do this with Python? Is the right way to create them as they’re needed?