Read the error message:
local variable 'constitution' referenced before assignment
That means that it cannot find a pre-existing variable called
constitution
that has been assigned a value before you try to access it's content.
So look at
File "/usercode/Actual_Functions.py", line 78, in __getRace__
and see where the variable is declared and assigned - and why it isn't in scope for the function.