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))
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))
相关文章推荐
- Python 4- more operations
- Python-中文编码
- wxPython中listbox用法实例详解
- python实现图片变亮或者变暗的方法
- python使用Image处理图片常用技巧分析
- Python运算符重载用法实例分析
- Python获取运行目录与当前脚本目录的方法
- Python常用小技巧总结
- python获取目录下所有文件的方法
- windows安装python3.4-ssh访问模块(paramiko)
- python 的threading模块
- Linear_regression与 Logistic_regression简单比较与python实现
- Python 类与作用域——一些测试
- 十分钟学习Python的进阶语法
- python学习笔记之――装饰器及对象
- python基础教程学习笔记---(6)文件读写
- 灰灰教你学python ~小黄鸡自动回复
- 从底层理解Python的执行
- 使用Python自动下载妹子图的图片到本地
- Python学习日记---字符串