# for 循环 for letter in 'Names': print(letter) ''' N a m e s ''' name_list=['walter','Nicole','d'] for name in name_list: print(name) ''' walter Nicole d '''
#遍历 0到4 for r in range(101): print(r) # 求101以内的和 sum=0 for i in range(101): sum=sum + i print(sum)
# 循环嵌套 boys =['Mike','Jack'] girl=['lily','Mary'] for i in boys: for j in girl: print('%s,kiss,%s'%(i,j))
标签:name,sum,循环,print,girl,101,2.12 From: https://www.cnblogs.com/haha1988/p/17526968.html