for(i=0,j=0;i<10,j<10;i++,j++)用python怎么写

时间:2014-12-05 12:54:15   收藏:0   阅读:1793

for i,j in zip(range(10),range(10)):
    i+=1
    j+=1


>>> i=j=0
>>> while i<10 and j<10:
    i+=1
    j+=1

for (x,y) in zip(range(10),range(10)): print x,y

for (i,j) in [(x,x) for x in range(0,10)]:        print str(i)+"="+str(j)

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!