python中for循环的用法

Python

1个回答

写回答

497415851

2022-10-19 21:36

+ 关注

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

for循环语法格式

forexpressioninobject:

for_suite

else:

else_suite

for语法格式扩展

forexpressioninobject:

for_suite

ifboolean_expression2:continue

ifboolean_expression3:break

else:

else_suite

举报有用(17分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号