For 循环
for every_letter in 'hello world':
print(every_letter)


Range 循环

利用嵌套循环实现九九乘法表

While 循环
1.在循环的过程中制造某些合适的条件使循环停下来

2.改变使循环成立的条件

这里的while可以理解成是if循环版,可以使用while-else结构,而while代码块中又存在着第二层的逻辑判断,这就构成了嵌套逻辑(nested condition).
for every_letter in 'hello world':
print(every_letter)
这里的while可以理解成是if循环版,可以使用while-else结构,而while代码块中又存在着第二层的逻辑判断,这就构成了嵌套逻辑(nested condition).
本文标题:python自学项目day4.循环 (Loop)与嵌套循环(Ne
本文链接:https://www.haomeiwen.com/subject/xwndmxtx.html
网友评论