Python中is和==的区别

>>> a=10
>>> b=10
>>> a is b
True
>>> c=10.0
>>> d=10.0
>>> c is d
False

>>> a==b
True
>>> c==d
True

>>> id(c)
47464176
>>> id(d)
47460624
>>> id(a)
505911152
>>> id(b)
505911152

posted @ 2014-04-13 21:53  tim胖  阅读(114)  评论(0编辑  收藏  举报