【发布时间】:2018-07-05 10:37:50
【问题描述】:
我用a = 'linux!', b = 'linux!', c = 'linux', d='linux',为什么会这样?
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'linux!'
>>> b = 'linux!'
>>> id(a)
2502413115552
>>> id(b)
2502414669112
>>> c = 'linux'
>>> d = 'linux'
>>> id(c)
2502413088616
>>> id(d)
2502413088616
>>>
【问题讨论】:
-
实施细节。如果这很重要,那么您可能做错了什么。
-
'linux' 是合法标识符,'linux!'不是。
标签: python python-3.x