• 员工管理系统


    # _*_ coding:utf-8 _*_
    # 开发人员:wht
    # 开发时间:2021-01-1114:19
    # 开发名称:1.py
    # 开发工具:PyCharm
    def init():
    print('***************欢迎****************')
    print('1查询员工')
    print('2新增')
    print('3编辑员工')
    print('4删除员工')
    print('退出')
    print('*****************************************')
    return int (input('请输入1~5'))
    emps = []
    def optertion():
    while True:
    num = init()
    if num == 1:
    showEmp()
    elif num == 2:
    addEmp()
    elif num == 3:
    editEmp()
    elif num == 4:
    delEmp()
    else:
    break
    def showEmp():
    print('进行查询')
    for emp in emps:
    print('编号:%s 姓名: %s 性别 %s 年龄 %s '% (emp['empId'],emp['empName'],emp['sex'],emp['age']))
    def addEmp():
    empId = int(input('编号'))
    empName = int(input('姓名'))
    sex = int(input('性别'))
    age = int(input('年龄'))
    emp ={'empId':empId ,'empName':empName ,'sex':sex ,'age':age}
    emps.append(emp)

    def editEmp():
    empId = int(input('编号'))
    empName = int(input('姓名'))
    sex = int(input('性别'))
    age = int(input('年龄'))
    for i in range(len(emps)):
    if empId == emps[i]['empsId']:
    emps[i]['empName']=empName
    emps[i]['sex'] = sex
    emps[i]['age'] = age
    break
    def delEmp():
    empId = int(input('输入编号'))
    for i in range(len(emps)):
    if empId == emps[i]['empId']:
    del(emps[i])
    break

    if __name__ =='__main__':
    optertion()
  • 相关阅读:
    贮油点问题(C++)
    二维数组操作
    二的幂次方(递归)
    [haoi2009]巧克力
    距离最远的牛
    ssh注解basedao简单的实现
    @service中构造方法报错
    spring注解 构造函数问题
    json与gson
    AsyncTask异步类的简单操作
  • 原文地址:https://www.cnblogs.com/wht123/p/14262475.html
Copyright © 2020-2023  润新知