23 lines
520 B
Python
23 lines
520 B
Python
class Employee:
|
|
"""A sample Employee class"""
|
|
|
|
def __init__(self, first, last, pay):
|
|
self.first = first
|
|
self.last = last
|
|
self.pay = pay
|
|
|
|
@property
|
|
def email(self):
|
|
return '{}.{}@email.com'.format(self.first, self.last)
|
|
|
|
@property
|
|
def fullname(self):
|
|
return '{} {}'.format(self.first, self.last)
|
|
|
|
def __repr__(self):
|
|
return "Employee('{}','{}','{}')".format(self.first,self.last,self.pay)
|
|
|
|
#e=Employee("machin","truc",500)
|
|
|
|
#r=print(e.fullname)
|