I am adding to a dictionary by doing .append within python
theDict = defaultdict(list)
theDict[theKey].append(theValue)
I'll try to print it out via
print theDict[valueKeyToLookUp]
But it always ends up looking like this:
[u'STRING_I_WANT']
I've tried doing print with str() at the front, but it still leaves the u' there.
I tried this: Python string prints as [u'String'] by doing
valueKeyToLookUp.encode('ascii')
But it still comes out the same. Other solutions look like they are looking up values via the position it is in the list by number, but I need to do it by value.
Any ideas?