Files
code_snippets/Python-SQLite/employee.py
T
2017-04-17 21:33:03 -06:00

20 lines
467 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)