⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
document
All Projects
document
Overview
Activity
Issues
Spent time
Gantt
Calendar
News
Documents
Wiki
Files
Download (1.06 KB)
Files
» 员工管理系统进阶版.py
UserName LastName
, 01/08/2025 07:44 PM
employees
=
{
"John"
:
{
# 一个季度的考勤天数
"attendance"
:
[
20
,
22
,
19
],
# 附加信息
"extra_info"
:
{
# 职位
"position"
:
"Manager"
,
# 联系方式
"contact"
:
"13012345678"
}
}
}
#添加新员工:向系统中添加一个新员工的所有信息(包括姓名、考勤天数和额外信息)。
employees
[
"tom"
]
=
{
"attendance"
:[
21
,
22
,
23
],
"extra_info"
:{
"position"
:
"staff"
,
"contact"
:
"17639546512"
}}
print
(
employees
)
#更新员工考勤:修改指定员工某个月的考勤天数。
d1
=
{
"tom"
:{
"attendance"
:[
20
,
21
,
23
],
"extra_info"
:
{
"position"
:
"staff"
,
"contact"
:
"17639546512"
}
}}
employees
.
update
(
d1
)
print
(
employees
)
#删除员工信息:从系统中删除某个员工的信息
employees
.
pop
(
"John"
)
print
(
employees
)
#查找员工信息:通过姓名查找并输出该员工的完整信息
d2
=
employees
.
get
(
"tom"
)
print
(
d2
)
« Previous
1
…
23
24
25
26
27
…
437
Next »
(25-25/437)
Loading...