如何在列表中打印德语元音变调?

2024-06-28 19:37:31 发布

您现在位置:Python中文网/ 问答频道 /正文

在我看来,pythonprint似乎无法在列表、字典和元组中打印德语元音变调。我怎样才能改变这个?你知道吗

# -*- coding: cp1252 -*-
print 'ÄÖÜ' #'ÄÖÜ'

x = 'ÄÖÜ'
print x #'ÄÖÜ'

x = ['ÄÖÜ',]
print x #['\xc4\xd6\xdc']
print x[0] #'ÄÖÜ'

x = [u'ÄÖÜ',]
print x #['\xc4\xd6\xdc']
print x[0] #'ÄÖÜ'

x = {'Ä': 'Ü'}
print x #{'\xc4': '\xdc'}
print x['Ä'] #'Ü'

Tags: 列表字典元组print元音codingxc4cp1252