复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
261. if a = 1 b = 2 if a < b: print 'a is less than b' 2. if else a = 1 b = 2 c = 0 if a < b and b == 2 or c > 0: print 'yes' else: print 'no' 3. if elif else a = 1 b = 2 c = 0 if a < b and b == 2 or not (c > 0): print 'yes' elif c == 0: print 'none' else: print 'no'
最后
以上就是冷傲海燕最近收集整理的关于Python 条件判断(if)的几种格式的全部内容,更多相关Python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复