在列表中打印Unicode字符

在列表中打印Unicode字符,第1张

在列表中打印Unicode字符

这是python2中的功能

但是在python3中,您将得到想要的:)。

$ python3Python 3.3.3 (default, Nov 26 2013, 13:33:18) [GCC 4.8.2] on linuxType "help", "copyright", "credits" or "license" for more information.>>> a = ['Mxc3xa3e']>>> print(a)['Mãe']>>>

或在python2中,您可以:

print '[' + ','.join("'" + str(x) + "'" for x in a) + ']'


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5655641.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-16
下一篇2022-12-16

发表评论

登录后才能评论

评论列表(0条)

    保存