Python

条件判断与循环结构

25分钟 0次学习

if-elif-else:用冒号和缩进,不用括号和花括号。

CODE0

for循环: for i in range(10): 遍历0~9。for item in list: 遍历元素。

while循环: while condition: 条件满足一直执行。

break/continue:同C语言。

range:range(stop)range(start,stop,step)