@@ -90,7 +90,9 @@ def straight_line_depreciation(
90
90
91
91
return list_of_depreciation_expenses
92
92
93
- def declining_balance_depreciation (useful_years : int ,
93
+
94
+ def declining_balance_depreciation (
95
+ useful_years : int ,
94
96
purchase_value : float ,
95
97
residual_value : float = 0.0 ,) -> list [float ]:
96
98
"""
@@ -141,10 +143,12 @@ def declining_balance_depreciation(useful_years: int,
141
143
new_book_value = book_value * (1 - depreciation_rate )
142
144
list_of_depreciation_expenses .append (round (book_value - new_book_value , 2 ))
143
145
book_value = new_book_value
144
-
146
+
145
147
return list_of_depreciation_expenses
146
148
147
- def sum_of_years_digits_depreciation (useful_years : int ,
149
+
150
+ def sum_of_years_digits_depreciation (
151
+ useful_years : int ,
148
152
purchase_value : float ,
149
153
residual_value : float = 0.0 ,) -> list [float ]:
150
154
"""
@@ -190,20 +194,15 @@ def sum_of_years_digits_depreciation(useful_years: int,
190
194
191
195
list_of_depreciation_expenses = []
192
196
193
- for i in range (1 , useful_years + 1 ):
194
- depreciation_value = (useful_years - (i - 1 )) / digits_sum * (purchase_value - residual_value )
197
+ for i in range (1 , useful_years + 1 ):
198
+ depreciation_value = (
199
+ (useful_years - (i - 1 )) / digits_sum * (purchase_value - residual_value )
200
+ )
195
201
list_of_depreciation_expenses .append (round (depreciation_value , 2 ))
196
202
197
-
198
203
return list_of_depreciation_expenses
199
204
200
205
201
-
202
-
203
-
204
-
205
-
206
-
207
206
if __name__ == "__main__" :
208
207
import doctest
209
208
0 commit comments