1.list和tuple的迭代
student_names = ['xiaoming','xiaohua','xiaohuang']
for name in student_names:
print (name)
2.dict字典的迭代
student_score = {'xiaoming': 20, 'xiaohua': 30, 'xiaohuang': 40}
#默认是key的迭代
for key in student_score:
print(key)
#对value的迭代
for value in student_score.values():
print(value)
#对key,value迭代
for k,v in student_score.items():
print(k,v)