arr=['a','b','c']
for x in arr:
print(x)
for i, v in enumerate(arr):
print(i, v)
arr=[{key:val},{..}]
for o in arr:
print(o) #{key:val}
arr={key:val}
for k,v in arr.items():
print(k,v)
for k in arr:
print(k,arr.get(k))
for i in range(10)
print(i)
for i in range(5,10):
print(i)
for ch in 'Python':
print '当前字母 :', ch
https://blog.csdn.net/weixin_40522801/article/details/106172470
arr = ['banana', 'apple', 'mango']
for item in arr:
print '当前 :', item
#for...in range()
#for...in enumerate() 、for...in() 、
#for...in zip()
arr = ['banana', 'apple', 'mango']
for index in range(len(arr)):
print '当前 :', arr[index]
for num in range(5,10):
if num%2 == 0:
break
print(num)
else:
print()
for i in arr[1:]
print(i)
#跳过最后一个元素
for i in arr[:-1]
print(i)
jsn=iter({"key":"val","key1":"val1"})
it=iter(jsn)
next(it)
for xx in it:
print(xx)