python循环语句之for

时间:2024-10-14 20:33:19

1、for循环的格式倦虺赳式:for 变量 in 列表或者字符串等: 循环满足条件时执行的代码else: 循环不满足条件时执行的代码 temp="zhangchong" for i i荏鱿胫协n temp: print(i) else: print("没有数据")------------------------------------- list1=['zhangchong','chong','hello','world'] for i in list1: print(i) else: print("没有数据")

python循环语句之forpython循环语句之forpython循环语句之forpython循环语句之for
© 2025 长短途
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com