pardon110
is在python中是比较操作符,对于字符串类型操作,基本上相当于"x is y" 等价于 "x == y"换而言之,字符串它比较的是内容。你可以这样C:\Users\Administrator>python
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Ana
conda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a="hello"
>>> a is "hello"
True
>>>更详情的is用法,可执行下列语句查看或直接到官网看中文版指引pydoc is