for 循环有没有这样的用法??

for 循环有没有这样的用法??



[Copy to clipboard] [ - ]
CODE:
chars = ['a','b','c']
nums = ['1','2','3']
for c,n in chars,nums:
    print c + n

请问有没有这样的用法??
如果没有,用什么函数可以实现类似功能??
谢谢。
a = ['a','b','c']
b = ['1','2','3']
result = map((lambda  x,y : x+y) ,a,b);
print result
for i in result: print i
恩。学习了。
for c, n in zip(chars, nums):
    print c + n



QUOTE:
原帖由 jiangpeng311 于 2008-10-29 13:23 发表
for c, n in zip(chars, nums):
    print c + n


Good!


QUOTE:
原帖由 jiangpeng311 于 2008-10-29 13:23 发表
for c, n in zip(chars, nums):
    print c + n


Very Good...


QUOTE:
原帖由 jiangpeng311 于 2008-10-29 13:23 发表
for c, n in zip(chars, nums):
    print c + n


fine~~~


QUOTE:
原帖由 bohemia 于 2008-10-29 11:55 发表
a = ['a','b','c']
b = ['1','2','3']
result = map((lambda  x,y : x+y) ,a,b);
print result
for i in result: print i

用map最简洁!顶这个


QUOTE:
原帖由 jiangpeng311 于 2008-10-29 13:23 发表
for c, n in zip(chars, nums):
    print c + n


good!
还是新手 都看不懂这两种用法。。汗