小编Dar*_*rmo的帖子

Python的upper()方法的奇怪行为

当我偶然发现一个奇怪的结果时,我正在使用一个包含str.upper()和str.lower()函数的Python脚本。当我?upper()函数传递字母(带有dasia和prosgegrammeni的大写字母Alpha,U + 1F89)时,结果??不是预期的?

复制代码:

print('?'.upper())
Run Code Online (Sandbox Code Playgroud)

版画

??
Run Code Online (Sandbox Code Playgroud)

这是预期的行为还是某种错误?

编辑:我替换为正确的字符。

python unicode uppercase python-3.7

3
推荐指数
1
解决办法
102
查看次数

标签 统计

python ×1

python-3.7 ×1

unicode ×1

uppercase ×1