运行结果
root@he-desktop:~# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> True and True
True
>>> False and True
False
>>> 1 == 1 and 2 == 1
False
>>> "test" == "test"
True
加分练习
1. python中很多类似!=和==这些操作符,试着找出一些等价操作符,比如<或者<=。
OperationMeaningNotes<strictly less than<=less than or equal>strictly greater than>=greater than or equal==equal!=not equal(1)isobject identityisnotnegated object identity