In [4]: {'a': "hello"}['a']
Out[4]: 'hello'
I want the output to instead be:
Out[4]: hello
What's the most elegant way to achieve this?
I am also using repr().rjust() later on to print a list of dictionaries into a neatly formatted table, and I notice the repr function also adds quotes which is annoying:
def print_dictionary(d): print repr(d['a']).rjust(10)
print_dictionary({'a':'hello'})
yields:
'hello'
when I want:
hello