第29个python程序:if语句
来源:互联网 发布:三观尽毁的淘宝买家秀 编辑:程序博客网 时间:2024/06/05 20:02
[root@mysql1 pshell]# cat ex29.py
#!/usr/bin/env Python
#-*-coding:utf-8-*-
people=20
cats=30
dogs=15
if people<cats:
print "too many cats! the world is doomed!"
if people>cats:
print "not many cats! the world is saved!"
if people<dogs:
print "the world is drooled on!"
if people>dogs:
print "the world is dry!"
dogs+=5
if people>=dogs:
print "people are grater than or equal to dogs."
if people<=dogs:
print "people are less than or equal to dogs."
if people==dogs:
print "people are logs."
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]# python ex29.py
too many cats! the world is doomed!
the world is dry!
people are grater than or equal to dogs.
people are less than or equal to dogs.
people are logs.
#!/usr/bin/env Python
#-*-coding:utf-8-*-
people=20
cats=30
dogs=15
if people<cats:
print "too many cats! the world is doomed!"
if people>cats:
print "not many cats! the world is saved!"
if people<dogs:
print "the world is drooled on!"
if people>dogs:
print "the world is dry!"
dogs+=5
if people>=dogs:
print "people are grater than or equal to dogs."
if people<=dogs:
print "people are less than or equal to dogs."
if people==dogs:
print "people are logs."
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]# python ex29.py
too many cats! the world is doomed!
the world is dry!
people are grater than or equal to dogs.
people are less than or equal to dogs.
people are logs.
0 0
- 第29个python程序:if语句
- 第30个python程序:else和if
- python连载第11篇 if 语句
- 第25个python程序
- 第12课 Python中if分支语句表达式结构
- Python的if语句
- Python-if语句
- python if语句语法
- python if语句
- Python-if语句
- Python学习:if语句
- Python-if语句
- python的if语句
- Python之if语句
- python if 语句
- Python if 语句
- Python if语句
- Python if 语句
- PAT 树的遍历 1086. Tree Traversals Again
- clang: error: no such file or directory
- 图像处理、显示中的行宽(linesize)、步长(stride)、间距(pitch)
- Foreground Estimation Based on Linear Regression Model With Fused Sparsity on Outliers
- Periodic Signal
- 第29个python程序:if语句
- ubuntu-make
- 使用adb抓取进程的hprof
- 一个统计当前网段活动IP数量的脚本
- 邮件系统的实现原理和协议解析
- 基于OTP的AES数据加密
- swift使用结构体还是类
- java多级文件复制
- Java的消亡