如何调整这本词典中的某些数据,我只能显示它们,但不能选择值,例如员工中表现最差的。
staff = {
'Williams': {
'position': 'marketing',
'performance': 71
},
'Kelly': {
'position': 'marketing',
'performance': 65
},
'Johnson': {
'position': 'marketing',
'performance': 49
},
'Thompson': {
'position': 'marketing',
'performance': 53
}
}
for key, value in staff.items():
print('The employee', key, 'is recommended for dismissal')
for k, v in value.items():
print(v)
这是输出:
The employee Williams is recommended for dismissal
marketing
71
The employee Kelly is recommended for dismissal
marketing
65
The employee Johnson is recommended for dismissal
marketing
49
The employee Thompson is recommended for dismissal
marketing
53