Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_4
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b8088484
authored
May 07, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
73ad6440
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
q.py
q.py
0 → 100644
View file @
b8088484
# class studentstudy:
# def __init__(self,name,gender,city,want_salary)
# self.name=name
# self.gender=gender
# self.city=city
# stlf.want_salary=want_salary
# def print_swtuding_course(self,course_name):
# print('{}学员们正在学习{}课程',format(self.name,course_name))
# def print_want_salary(self):
# print('{}学员学习完成后的期望薪资为{}'format(salf.name,self.want_salary))
# xj=studentstudy('xjj','女','北京',16000)
# xj.print_studing_course('python自动化')
# xj.print_want_salary()
# xh = studentstudy('xxh','女','上海',20000)
# xh = print_studing_course('python测开')
# xh.print_want_salary()
# xs = studentstudy('xxh','女','上海',20000)
# xs = print_studing_course('python测开')
# xs.print_want_salary()
class
Employee
:
def
__init__
(
self
,
name
,
work_years
,
city
,
salary
,
job_name
):
self
.
name
=
name
self
.
work_years
=
work_years
self
.
city
=
city
self
.
salary
=
salary
self
.
job_name
=
job_name
def
print_year_salary
(
self
):
print
(
'{}员工一年薪资总计为{}'
.
format
(
self
.
name
,
self
.
salary
*
12
))
def
print_employee_info
(
self
):
print
(
'员工{}工作年限为{}年'
format
(
self
.
name
,
self
.
work_years
))
el
=
Employee
(
'xww'
,
3
,
'北京'
,
18000
,
'高级测速工程师'
)
el
.
print_year_salary
(
'python自动化'
)
el
.
print_employee_info
()
e2
=
Employee
(
'lh'
,
6
,
'北京'
,
21500
,
'高级工程师'
)
e2
.
print_year_salary
(
'python测开'
)
e2
.
print_employee_info
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment