>>> a = True>>> b = 0>>> not bTrue>>> not aFalse>>> >>> mylist = []>>> not mylistTrue# mylist为空本身是一个假
and
>>> aTrue>>> b0>>> a and b0# 真真为真 真假为假 假假为假
or
>>> a or bTrue# 真假为真 真真为真 假假为假
is
>>> a = 1>>> b = 1>>> a is bTrue>>> mylist = [1,2,3,4]>>> mylist1 = [1,2,3,4]>>> mylist is mylist1False>>> mylist[0] is mylist1[0]True>>> id(mylist)140613557719560>>> id(mylist1)140613557692424>>> id(mylist[0])9330880>>> id(mylist1[0])9330880>>> mytuple = (1,2,3,4)>>> mytuple1 = (1,2,3,4)>>> mytuple is mytuple1False# 根据地址来判断,相同地址才会被认为是同一个对象,a is b True -> a和b是同一个对象