您的位置:首页 > 编程语言 > Python开发

笨办法学python加分习题28

2018-02-07 12:46 459 查看
python版本:3      若有错误,敬请指出
模块名称:测试.py

#加分习题28
print(True and True)
print("1.True")
print(False and True)
print("2.False")
print(1 == 1 and 2 == 1)
print("3.False")
print("test" == "test")
print("4.True")
print(1 == 1 or 2 != 1)
print("5.True")
print(True and 1 == 1)
print("6.True")
print(False and 0 != 0)
print("7.False")
print(True or 1 == 1)
print("8.True")
print("test" == "testing")
print("9.False")
print(1 != 0 and 2 == 1)
print("10.False")
print("test" != "testing")
print("11.True")
print("test" == 1)
print("12.False")
print(not (True and False))
print("13.True")
print(not (1 == 1 and 0 != 1))
print("14.False")
print(not (10 == 1 or 1000 == 1000))
print("15.False")
print(not (1 != 10 or 3 == 4))
print("16.False")
print(not ("testing" == "testing" and "Zed" == "Cool Guy"))
print("17.True")
print(1 == 1 and not ("testing" == 1 or 1 == 0))
print("18.True")
print("chunky" == "bacon" and not (3 == 4 or 3 == 3))
print("19.False")
print(3 == 3 and not ("testing" == "testing" or "Python" == "Fun"))
print("20.False")

#1#2
#1.== : 等于
#2.!= : 不等于
#3.<> : 不等于
#4. > : 大于
#5. < : 小于
#6.>= : 大于or等于
#7.<= : 小于or等于
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python