摘要:
1.pass 过 占位作用,防止没有内容而代码报错,先用pass占位,后期可将代码补进来if 10==10: pass 2.break 终止'当前'循环(1)打印1~10,遇到5就终止i=1while i<=10: if i==5: break print(i) i+=1(2)仅仅终止当前循环i=1 阅读全文
posted @ 2020-07-11 15:18
HaCi-25
阅读(316)
评论(0)
推荐(0)
摘要:
1.打印一行十个小星星(单项循环)i=0while i<10: print('*',end='') i+=1 2.通过变量打印一行十个小星星i=0strvar=''while i<10: strvar+='*' i+=1print(strvar) 3.打印十行十列小星星 (1)单项循环: i=0wh 阅读全文
posted @ 2020-07-11 14:28
HaCi-25
阅读(381)
评论(0)
推荐(0)
浙公网安备 33010602011771号