Jun-04-2018, 11:37 PM
Output:In [14]: a = 'c'
In [15]: globals()[a] = 1
In [16]: c
Out[16]: 1
In [17]: b = 'd'
In [18]: exec('{} = 10'.format(b))
In [19]: b
Out[19]: 'd'
In [20]: d
Out[20]: 10
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.