@@ -94,14 +94,15 @@ def straight_line_depreciation(
9494def declining_balance_depreciation (
9595 useful_years : int ,
9696 purchase_value : float ,
97- residual_value : float = 0.0 ,) -> list [float ]:
97+ residual_value : float = 0.0 ,
98+ ) -> list [float ]:
9899 """
99100 Calculate the depreciation expenses over the given period,
100101 using the declining balance method
101102 :param useful_years: Number of years the asset will be used
102103 :param purchase_value: Purchase expenditure for the asset
103104 :param residual_value: Residual value of the asset at the end of its useful life
104- :return: A list of annual depreciation expenses over the asset's useful life,
105+ :return: A list of annual depreciation expenses over the asset's useful life,
105106 rounded to the nearest cent
106107
107108 >>> declining_balance_depreciation(10,1100.0,100.0)
@@ -139,7 +140,7 @@ def declining_balance_depreciation(
139140
140141 list_of_depreciation_expenses = []
141142
142- for _ in range (1 , useful_years + 1 ):
143+ for _ in range (1 , useful_years + 1 ):
143144 new_book_value = book_value * (1 - depreciation_rate )
144145 list_of_depreciation_expenses .append (round (book_value - new_book_value , 2 ))
145146 book_value = new_book_value
@@ -150,14 +151,15 @@ def declining_balance_depreciation(
150151def sum_of_years_digits_depreciation (
151152 useful_years : int ,
152153 purchase_value : float ,
153- residual_value : float = 0.0 ,) -> list [float ]:
154+ residual_value : float = 0.0 ,
155+ ) -> list [float ]:
154156 """
155157 Calculate the depreciation expenses over the given period,
156158 using the sum of years' digits method
157159 :param useful_years: Number of years the asset will be used
158160 :param purchase_value: Purchase expenditure for the asset
159161 :param residual_value: Residual value of the asset at the end of its useful life
160- :return: A list of annual depreciation expenses over the asset's useful life,
162+ :return: A list of annual depreciation expenses over the asset's useful life,
161163 rounded to the nearest cent
162164
163165 >>> sum_of_years_digits_depreciation(10,1100.0,100.0)
0 commit comments