Python2 中字符类型的一些坑

📝

内容提要

问题 有一道面试题是这样的: a = u'China' b = 'China' c = u'中国' d = '中国' # 1 print '%s %s' % (a, b) # 2 print '%s' % c # 3 print '%s' % d # 4 print '%s %s' % (c, d) 判断打印后的效果。 先说正确答案,只有最后一行会报错。 分析 在 Python2...

🏷️

标签

➡️

继续阅读