Javascript Modify Variable Outside Function Python Syntax