23、字典
2023-07-30 11:16:23
|
来源:哔哩哔哩
(资料图)
my_dict={"王力宏":{"部门":"科技部","工资":3000,"级别":1}, "周杰伦":{"部门":"市场部","工资":5000,"级别":2}, "林俊杰":{"部门":"市场部","工资":7000,"级别":3}, "张学友":{"部门":"科技部","工资":4000,"级别":1}, "刘德华":{"部门":"市场部","工资":6000,"级别":2} }for name in my_dict: if my_dict[name]["级别"]==1: my_dict[name]["级别"]+=1 my_dict[name]["工资"]+=1000print(my_dict)