当前位置:知知馆 >

经验

> python中for循环的用法

python中for循环的用法

python中for循环的用法

for循环是指一个通用的序列迭代器,用于遍历任何有序的序列对象内的元素,可用于字符串、元组、列表和其它内置可迭代对象,以及通过类所创建的新对象。

for循环语法格式

forexpressioninobject:

for_suite

else:

else_suite

for语法格式扩展

forexpressioninobject:

for_suite

ifboolean_expression2:continue

ifboolean_expression3:break

else:

else_suite

标签: python
  • 文章版权属于文章作者所有,转载请注明 https://zhizhiguan.com/jingyan/g29p4g.html