"""    遍历字典
"""user_0 = {
'username': 'zhou', 'age': 18, 'sex': 'm'}

name_0 = {
'jen': 'python', 'sarah': 'c', 'edward': 'ruby', 'phil': 'python'}
for key,value in user_0.items():
print('\nkey:'+key)
print('value:'+str(value))

for key in user_0.keys():
print(key,end = ' ')
print('\n')
for name in sorted(name_0.keys()):
print(name, end=' ')