4.1 while循环的基础应用
一、while循环
根据条件判断,重复或跳出某一个事情
语法:
while 条件: 满足条件做的事情简单案例
i = 0 while i < 10: print("第%d次" % (i + 1)) i += 1 print("成功了")
Last updated
Was this helpful?
根据条件判断,重复或跳出某一个事情
语法:
while 条件:
满足条件做的事情简单案例
i = 0
while i < 10:
print("第%d次" % (i + 1))
i += 1
print("成功了")Last updated
Was this helpful?
Was this helpful?