Is it possible to define global variables in a function in Python April 17, 2023 by Tarik Yes, but why? def a(): globals()['something'] = 'bob'