コード例 #1
0
def lessThan70000(cross_income):
    taxrate = 30
    tax_range = calculation.subtract(cross_income, 48000)
    tax = calculation.multiply(tax_range, taxrate / 100)
    tax = tax + lessThan48000(48000)
    tax = tax + lessThan14000(14000)
    return tax
コード例 #2
0
ファイル: PAYE.py プロジェクト: lelua/flask
def overThan180000(gross_income):
    if gross_income <= 180000:
        return None
    taxrate = 39
    tax_range = calculation.subtract(gross_income, 180000)
    tax = calculation.multiply(tax_range, taxrate / 100)
    tax = tax + lessThan180000(180000)
    return tax
コード例 #3
0
ファイル: PAYE.py プロジェクト: kitmehta77/PycharmProjects
def lessThan180000(gross_income):
    taxrate = 33
    tax_range = calculation.subtract(gross_income, 70000)
    tax = calculation.multiply(tax_range, taxrate / 100)
    tax = tax + lessThan70000(70000)
    """tax = tax + lessThan48000(48000)
    tax = tax + lessThan14000(14000)"""
    return tax
コード例 #4
0
ファイル: PAYE.py プロジェクト: lelua/flask
def lessThan48000(gross_income):
    if gross_income <= 14000 or gross_income > 48000:
        return None
    taxrate = 17.5
    tax_range = calculation.subtract(gross_income, 14000)
    tax = calculation.multiply(tax_range, taxrate / 100)
    tax = tax + lessThan14000(14000)
    return tax
コード例 #5
0
ファイル: PAYE.py プロジェクト: lelua/flask
def lessThan180000(gross_income):
    if gross_income <= 70000 or gross_income > 180000:
        return None
    taxrate = 33
    tax_range = calculation.subtract(gross_income, 70000)
    tax = calculation.multiply(tax_range, taxrate / 100)
    tax = tax + lessThan70000(70000)
    return tax
コード例 #6
0
 def test_subtract_with_zero(self):
     """Test that the subtract of value with 0, returns the correct total"""
     result = calculation.subtract(5, 0)
     self.assertEqual(result, 5)
コード例 #7
0
 def test_subtract_less_zero(self):
     """Test that the subtract of two values less than 0, returns the correct total"""
     result = calculation.subtract(-5, -6)
     self.assertEqual(result, 1)
コード例 #8
0
 def test_subtract_more_zero(self):
     """Test that the subtract of two values more than 0, returns the correct total"""
     result = calculation.subtract(10, 5)
     self.assertEqual(result, 5)
コード例 #9
0
 def test_sebtract(self):
     self.assertEqual(calculation.subtract(12, 6), 6)
コード例 #10
0
 def subtract(self, num1, num2):
     if subtract(num1, num2) < 0:
         self.failed('Result < 0)')
コード例 #11
0
ファイル: main.py プロジェクト: dschloe/temp_def_class
def main():
    print("안녕하세요, main() 입니다. ")
    print("a + b = ", calculation.subtract(a, b))
    print("a - b = ", calculation.plus(a, b))
    print("a * b = ", calculation.multiple(a, b))
コード例 #12
0
ファイル: test7.py プロジェクト: SuYOUNGgg/JavaStudy
# import sys
# sys.path.append("c:\\Python_modules")

import calculation as calc
r = calc.add(2, 3)
r2 = calc.divide(4, 2)
r3 = calc.mulply(2, 2)
r4 = calc.subtract(4, 3)
print(r, r2, r3, r4)
print(dir(calc))
コード例 #13
0
 def test_subtract(self, num1, num2):
     """Test subtraction functionality."""
     if subtract(num1, num2) < 0:
         self.failed(
             f'Test failed because result of subtracting {num2} from {num1} is less then 0'
         )
コード例 #14
0
def main():
    print("안녕하세요, main() 입니다.")
    print("a+b=",calculation.subtract(a,b))
    print("a=b=", calculation.plus(a,b))