human
Is it possible to define global variables in a function in Python
assistant
Here is some code to define global variable `something` with value `bob`

globals()['something'] = 'bob'

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.