if-elif-else
来源:互联网 发布:java搭建服务器端 编辑:程序博客网 时间:2024/06/05 19:35
if-elif-else
任务
如果按照分数划定结果:
90分或以上:excellent
80分或以上:good
60分或以上:passed
60分以下:failed
请编写程序根据分数打印结果。
- ?不会了怎么办
多个条件判断需要使用多个elif。
参考代码:
score = 85if score >= 90: print 'excellent'elif score >= 80: print 'good'elif score >= 60: print 'passed'else: print 'failed'
0 0
- if-elif-else使用
- if-elif-else
- #if, #elif, #else和#endif
- #if, #elif, #else, #endif 使用
- shell-007: if elif else
- shell语法if else elif
- if-elif-else的理解
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- Python if elif else语句
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- #if, #elif, #else, #endif 使用
- sqlite的数据导入导出
- iOS UIView非常用方法及属性详解
- 【笔记】 《js权威指南》- 第6章 对象
- Java经典设计模式(3):十一种行为型模式(附实例和详解)
- April Fools Day Contest 2016
- if-elif-else
- 百度地图IOS 自定义图标气泡viewForAnnotation不调用
- IP地址从头说起
- Android Http请求头与响应头的学习
- Android学习笔记---第一天---布局
- 三角形类 构造函数
- 93. Restore IP Addresses 回溯算法
- iOS获得设备型号
- 算法总结(2)直接插入排序