test-module.py 446 B

123456789101112131415161718192021
  1. class Employee:
  2. """A sample Employee class"""
  3. def __init__(self, first, last):
  4. self.first = first
  5. self.last = last
  6. print('Created Employee: {} - {}'.format(self.fullname, self.email))
  7. @property
  8. def email(self):
  9. return '{}.{}@email.com'.format(self.first, self.last)
  10. @property
  11. def fullname(self):
  12. return '{} {}'.format(self.first, self.last)
  13. emp_1 = Employee('John', 'Smith')