formatted string like---> u'720 S'

B

Bell, Kevin

I'm building a dictionary from values a database and upon print the
dictionary I see key value pairs like this:

u'Briarcliff' : [u'2500 E'],
u'Shumway' : [ u'2600 E']

do I need to slice off the "u", or anything? I know it has something to
do with unicode but I don't know how to treat it.
 
S

Steven D'Aprano

I'm building a dictionary from values a database and upon print the
dictionary I see key value pairs like this:

u'Briarcliff' : [u'2500 E'],
u'Shumway' : [ u'2600 E']

do I need to slice off the "u", or anything? I know it has something to
do with unicode but I don't know how to treat it.

No. The u is part of the display of the string, just like the quote marks.

Ordinary strings are printed with ' ' delimiters.
Unicode strings are printed with u' ' delimiters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top