Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Employee:
- raise_amount = 1.05
- num_of_empl = 0
- def __init__(self,first,last,pay):
- self.first = first
- self.last = last
- self.pay = pay
- self.email = first + '.' + last + '@company.com'
- Employee.num_of_empl +=1
- def fullname(self):
- return '{} {}'.format(self.first, self.last)
- def apply_raise(self):
- self.pay = int(self.pay * self.raise_amount)
- emp_1 = Employee('Corey','Shafer', 50000)
- emp_2 = Employee('Vanila','Parker', 40000)
- print(emp_1.__dict__)
- print(emp_1.raise_amount)
- print(emp_1.pay)
- # emp_1.pay *= 1.01
- emp_1.apply_raise()
- emp_1.raise_amount = 1.06
- emp_1.apply_raise()
- print(emp_1.pay)
- print(emp_1.num_of_empl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement