标签:for循环
#!/usr/bin/env python
#coding:utf-8
#for循环和else语法
for i in range(0,10,2):
print "loop: ",i
else:
print "已经跑完了"
#continue+for循环
for i in range(10):
if i < 5:
print i
else:
continue
print ‘this is ta
#break+for循环,break只跳出当前小的被嵌套的for循环
for i in range(10):
print ‘-------‘,i
for j in range(10):
if j < 5:
print j
else:
break
本文出自 “YHT的运维笔记” 博客,请务必保留此出处http://yht1990.blog.51cto.com/9014030/1941007
标签:for循环
原文地址:http://yht1990.blog.51cto.com/9014030/1941007