### 字典的键值对的遍历
dic = {'name': 'chen', 'age': 23, 'class': 1}
## 1.直接获取建,根据键取值
for key in dic:
print(key,dic[key])
## 2. 通过items方法获取键值取值,速度慢,少用
for key,value in dic.items():
print(key,value)
## 3. 利用keys方法获取键取值
for key in dic.keys():
print(key,dic[key])
## 4. 通过values方法获取值,但是无法获得键
for value in dic.values():
print(value)