美文网首页Python五期爬虫作业
【Python爬虫作业】- 逻辑运算

【Python爬虫作业】- 逻辑运算

作者: 丽雁解 | 来源:发表于2017-12-26 17:46 被阅读11次
print(True and True)
print(False and True)
print(1 == 1 and 2 == 1)
print("test" == "test")
print(1 == 1 or 2 != 1)
print(True and 1 == 1)
print(False and 0 != 0)
print(True or 1 == 1)
print("test" == "testing")
print(1 != 0 and 2 == 1)
print("test" != "testing")
print("test" == 1)
print(not (True and False))
print(not (1 == 1 and 0 != 1))
print(not (10 == 1 or 1000 == 1000))
print(not (1 != 10 or 3 == 4))
print(not ("testing" == "testing" and "Zed" == "Cool Guy"))
print(1 == 1 and not ("testing" == 1 or 1 == 0))
print(3 == 3 and not ("testing" == "testing" or "Python" == "Fun"))

运行结果:
True
False
False
True
True
True
False
True
False
False
True
False
True
False
False
False
True
True
False

相关文章

网友评论

    本文标题:【Python爬虫作业】- 逻辑运算

    本文链接:https://www.haomeiwen.com/subject/xbujgxtx.html