首页 > IT职业 > IT图书 > python中一些有意思的东西
a=3;b=3
print a is b #True
print a+3 is b+3 #True
print a+300 is b+300 #False
print type([]) #
print type(()) #
print type(([])) #
print type(([(())])) #
c = d = 4; c *= 4
print c is d #False
e = f = [4]; e *= 4
print e is f #True
print type({():()}) #
print type({[]:[]}) #TypeError: unhashable type: 'list'
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2203/viewspace-2798024/ ,如需转载,请注明出处,否则将追究法律责任。