python循环语句之for
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("没有数据")
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:30
阅读量:96
阅读量:80
阅读量:39
阅读量:90