4.6 for循环的基础语法
一、for循环基础
for循环是一种轮询机制,是对一批内容逐个处理
可以循环的变量为:字符串换、列表、元组等
格式:
for 临时变量 in 变量: 处理内容例子
name = "Snow" for s in name: print(s)
Last updated
Was this helpful?
for循环是一种轮询机制,是对一批内容逐个处理
可以循环的变量为:字符串换、列表、元组等
格式:
for 临时变量 in 变量:
处理内容例子
name = "Snow"
for s in name:
print(s)
Last updated
Was this helpful?
Was this helpful?