Python ans local variables
Hello As an exercise to python, I'm creating a "character generator" for a paper roleplaying game I own (Shadowrun). This code involves a lot of manipulations on a few "characters attributes" which I define as variables in my code. Very rapidly, I reach "UnboundLocalError" as my variables are modified in functions (and sub functions). I get it, I need to declare them as global if I want to modify them inside a function. But it is getting insane. I'm writing global so many times! For "if statement", it seems I have to repeat the global declarations in every part of the if statement as the code jumps to the adequate if. Same when applying a new function to the same variable. So what is the proper way of modifying variables in a code when using multiple functions affecting the same variable? https://code.sololearn.com/c17azYp5j0y5/?ref=app