Python 3基础教程8-if elif else语句
2017-05-05 23:39
567 查看
本文来介绍if -elif-else语句,直接以下例子。
# 这里介绍 if elif else语句
x = 5
y = 8
z = 15
if x > y:
print('x is greater than y')
elif x < z:
print('x is less than z')
else:
print('上面的if 和elfi 语句都不会被执行的时候,才会到这里执行代码')
# 这里介绍 if elif else语句
x = 5
y = 8
z = 15
if x > y:
print('x is greater than y')
elif x < z:
print('x is less than z')
else:
print('上面的if 和elfi 语句都不会被执行的时候,才会到这里执行代码')
相关文章推荐
- Python学习入门基础教程(learning Python)--3.3.4 Python的if-elif-else语句
- Python 3基础教程8-if else语句
- 2.8 python中的if...elif...else语句 [python入门教程]
- Python学习入门基础教程(learning Python)--3.2 if-else分支语句
- Python 条件判断语句(if ,elif, else)
- Python if elif else语句
- python 笔记 if语句中的elif和else 《笨办法学Python》习题30 ——1.2
- Python学习入门基础教程(learning Python)--3.2 if-else分支语句 .
- Python-if-elif-else语句
- Python 3基础教程7-if语句
- Python-if-elif-else语句
- Python-if-elif-else语句
- python基础教程共60课-第23课if、elif、else
- Python 3从入门到精通6-if,elif,else语句
- Python的 if .else.elif语句详解
- Python-if-elif-else语句
- Python3使用独立的if语句与使用if-elif-else结构的不同之处
- Python-if-elif-else语句
- python3 if elif else 分支语句
- python 流控制 if else, elif