I want to have access to a key in a dictionary that has a c str.format(). How can i do this?
For example, the format for a key without a dot works:
>>> "{hello}".format(**{ 'hello' : '2' })
'2'
But this is not so when the key has a point in it:
>>> "{hello.world}".format(**{ 'hello.world' : '2' })
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'hello'
source
share