Python Unboundlocalerror Cannot Access Local Variable Score