For a dictionary
d={'foo1': 1, 'foo2': 2, 'foo3': 3}, what is the most efficient way to assign the strings to their definitions:
foo1=1
foo2=2
foo3=3
When no assignment statements are used, I need to call the entry with the dictionary, eg. d['foo1'], but I don't plan to use this.
Note: Thanks for pointing out that it was a string. However, I am now assigning the string terms to their corresponding values in the dictionary.
globals().update(d)if you're setting global variables.