Source Code:
(back to article)
value = globals().get('my_variable') if value is not None: print(f'my_variable exists in the global namespace and has value {value}') else: print('my_variable does not exist in the global namespace')
Result:
Report an issue