16-嵌套 for

16-嵌套 for

语法讲解 今天学: 循环语句 for / while for i in range(2): for j in range(2): print(i,j) 小练习 运行下面代码后输出是什么? f

阅读更多 →
15-while else

15-while else

语法讲解 今天学: 循环语句 for / while i=0 while i<2: print(i) i+=1 else: print('done')

阅读更多 →
14-while + continue

14-while + continue

语法讲解 今天学: 循环语句 for / while i=0 while i<4: i+=1 if i==2: continue print(i)

阅读更多 →
13-while + break

13-while + break

语法讲解 今天学: 循环语句 for / while i=0 while True: if i==2: break print(i) i+=1 小练习

阅读更多 →
12-while 累加

12-while 累加

语法讲解 今天学: 循环语句 for / while i=1 s=0 while i<=3: s+=i i+=1 print(s) 小练习 运行下面代码后输出是什么? i

阅读更多 →
11-while 基础

11-while 基础

语法讲解 今天学: 循环语句 for / while i=0 while i<3: print(i) i+=1 小练习 运行下面代码后输出是什么? i=0 while i

阅读更多 →
10-continue 跳过

10-continue 跳过

语法讲解 今天学: 循环语句 for / while for i in range(5): if i%2==0: continue print(i) 小练习 运行下面代码后输出是什么? fo

阅读更多 →
09-break 终止

09-break 终止

语法讲解 今天学: 循环语句 for / while for i in range(5): if i==3: break print(i) 小练习 运行下面代码后输出是什么? for i i

阅读更多 →
08-enumerate

08-enumerate

语法讲解 今天学: 循环语句 for / while for i,x in enumerate([10,20]): print(i,x) 小练习 运行下面代码后输出是什么? for i,x in e

阅读更多 →
07-遍历列表

07-遍历列表

语法讲解 今天学: 循环语句 for / while for x in [1,2,3]: print(x*2) 小练习 运行下面代码后输出是什么? for x in [1,2,3]: print(x

阅读更多 →