Skip to content

Instantly share code, notes, and snippets.

@firemanxbr
Created February 15, 2020 12:21
Show Gist options
  • Save firemanxbr/9b0b3257ccbc66c3641a6aa42eabe614 to your computer and use it in GitHub Desktop.
Save firemanxbr/9b0b3257ccbc66c3641a6aa42eabe614 to your computer and use it in GitHub Desktop.
class Employee():
tax = 1.20
def __init__(self, first, last, pay, email):
self.first = first
self.last = last
self.pay = pay
self.email = email
def fullname(self):
return f'{self.first} {self.last}'
def month_pay(self):
month = self.pay / 12
return '{}'.format(month)
def taxes(self):
tax_to_pay = (self.pay * self.tax) - self.pay
return f'{tax_to_pay}'
if __name__ == "__main__":
ints_1 = Employee(first='Marcelo', last='Barbosa', pay=100000, email='me@localhost')
ints_1.tax = 1.45
print(ints_1.taxes())
ints_2 = Employee(first='Test', last='User', pay=100000, email='me@localhost')
print(ints_2.taxes())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment