Python unicode string literals :: what's the difference between '\u0391' and u'\u0391'
问题 I am using Python 2.7.3. Can anybody explain the difference between the literals: '\u0391' and: u'\u0391' and the different way they are echoed in the REPL below (especially the extra slash added to a1): >>> a1='\u0391' >>> a1 '\\u0391' >>> type(a1) <type 'str'> >>> >>> a2=u'\u0391' >>> a2 u'\u0391' >>> type(a2) <type 'unicode'> >>> 回答1: You can only use unicode escapes ( \uabcd ) in a unicode string literal. They have no meaning in a byte string. A Python 2 Unicode literal ( u'some text' )