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

Python 5 -Logic

2015-06-01 04:25 591 查看
True (T)

False (F)

NOT AND OR

-------------------------------------------------------------------------------------------------------------------------------------------------------------

a=True

b=False

print a

print b

print "==="

print not a

print a and b

print a or b

print "==="

print (a and b) or (c and (not d))

------------------------------------------------------------------------------------------------------------------------------------------------------

#Comparison Operators

#> < >= <= == !=

a=7>3

print a

x=5

y=5

b=x>y

print b

c= "Hello" == "Hello"

print c

d=20.6 <= 18.3

print d

print (a and b) or (c and (not d))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: