告诉我怎么可能:
сhar = input()
print(char)
Traceback (most recent call last): File "test.py", line 2, in print(char) NameError: name 'char' is not defined
为了让事情更有趣,可以考虑在复制使用双重检查的python版本:
import sys
print(f'Python version on this machine:\n{sys.version}')
сhar = input()
print(char)
Python version on this machine:
3.7.4 (default, Jul 13 2019, 14:20:24)
[GCC 6.3.0 20170516]
type anything
Traceback (most recent call last):
File "main.py", line 5, in
print(char)
NameError: name 'char' is not defined
你的
char = input()
包含西里尔字符С(参见here) 而print(char)
是纯拉丁语。你知道吗这也让我想起了greek question mark prank,其中分号和问号的字符呈现几乎相同:
;;
编辑:wim更快
Unicode标识符名称。你知道吗
其中一个c是普通的拉丁小写字母c,而另一个是
chr(0x441)
,即'CYRILLIC SMALL LETTER ES'。在一台典型的机器上,它们将以非常相似(或完全相同)的glyph呈现给终端。你知道吗相关问题 更多 >
编程相关推荐