Skip to content

Instantly share code, notes, and snippets.

@prp-e
Created June 2, 2021 13:22
Show Gist options
  • Save prp-e/1ef085a56f2ccc3a579f51bad8caa9d5 to your computer and use it in GitHub Desktop.
Save prp-e/1ef085a56f2ccc3a579f51bad8caa9d5 to your computer and use it in GitHub Desktop.
Employee Project
class Employee
def __init__(self, salary:float)
self.salary = salary
def calTax(self):
self.tax = 0
if self.salary <= 2300000:
self.tax = 0
elif 2300000 < self.salary <= 5000000:
self.tax = self.salary * 10 / 100
elif self.salary > 5000000:
base_tax = (self.salary - 5000000) * 10 / 100
self.tax = base_tax + (self.tax * 20 / 100)
return self.tax
def calInsurance(self):
return self.insurance_fee = self.salary * 10 / 100
def show_information(self):
return { "salary" : self.salary, "insurance" : self.calInsurance(self.salary), "tax": self.calTax(self.salary)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment