閉關(guān)修行中......
Because zip
combines every two independent strings into a tuple
, and Chinese in tuples, lists, etc. data structures are stored according to unicode
or hex
, so what you see will be this result, which does not affect the use, nor is it garbled, because by directly traversing it and printing out the elements separately, you can see the content that can be recognized by humans. You can use the following code to help understand:
# coding: utf8
a = u'你好'
print a # 獨(dú)立打印
s = [] # 創(chuàng)建列表, 并存入列表
s.append(a)
print s # 將整個(gè)列表打印, 看到unicode編碼存儲(chǔ)的內(nèi)容
print s[0] # 將元素單獨(dú)打印, 看到正常的內(nèi)容
#### 輸出 ###
你好
[u'\u4f60\u597d']
你好