@@ -35,7 +35,8 @@ def straight_line_depreciation(
35
35
residual_value : float = 0.0 ,
36
36
) -> list [float ]:
37
37
"""
38
- Calculate the depreciation expenses over the given period using the straight-line method
38
+ Calculate the depreciation expenses over the given period,
39
+ using the straight-line method
39
40
:param useful_years: Number of years the asset will be used
40
41
:param purchase_value: Purchase expenditure for the asset
41
42
:param residual_value: Residual value of the asset at the end of its useful life
@@ -91,13 +92,15 @@ def straight_line_depreciation(
91
92
92
93
def declining_balance_depreciation (useful_years : int ,
93
94
purchase_value : float ,
94
- residual_value : float = 0.0 ,):
95
+ residual_value : float = 0.0 ,) -> list [ float ] :
95
96
"""
96
- Calculate the depreciation expenses over the given period using the declining balance method
97
+ Calculate the depreciation expenses over the given period,
98
+ using the declining balance method
97
99
:param useful_years: Number of years the asset will be used
98
100
:param purchase_value: Purchase expenditure for the asset
99
101
:param residual_value: Residual value of the asset at the end of its useful life
100
- :return: A list of annual depreciation expenses over the asset's useful life, rounded to the nearest cent
102
+ :return: A list of annual depreciation expenses over the asset's useful life,
103
+ rounded to the nearest cent
101
104
102
105
>>> declining_balance_depreciation(10,1100.0,100.0)
103
106
[234.53, 184.52, 145.18, 114.23, 89.87, 70.71, 55.64, 43.77, 34.44, 27.1]
@@ -134,7 +137,7 @@ def declining_balance_depreciation(useful_years: int,
134
137
135
138
list_of_depreciation_expenses = []
136
139
137
- for i in range (1 , useful_years + 1 ):
140
+ for _ in range (1 , useful_years + 1 ):
138
141
new_book_value = book_value * (1 - depreciation_rate )
139
142
list_of_depreciation_expenses .append (round (book_value - new_book_value , 2 ))
140
143
book_value = new_book_value
@@ -143,13 +146,15 @@ def declining_balance_depreciation(useful_years: int,
143
146
144
147
def sum_of_years_digits_depreciation (useful_years : int ,
145
148
purchase_value : float ,
146
- residual_value : float = 0.0 ,):
149
+ residual_value : float = 0.0 ,) -> list [ float ] :
147
150
"""
148
- Calculate the depreciation expenses over the given period using the sum of years' digits method
151
+ Calculate the depreciation expenses over the given period,
152
+ using the sum of years' digits method
149
153
:param useful_years: Number of years the asset will be used
150
154
:param purchase_value: Purchase expenditure for the asset
151
155
:param residual_value: Residual value of the asset at the end of its useful life
152
- :return: A list of annual depreciation expenses over the asset's useful life, rounded to the nearest cent
156
+ :return: A list of annual depreciation expenses over the asset's useful life,
157
+ rounded to the nearest cent
153
158
154
159
>>> sum_of_years_digits_depreciation(10,1100.0,100.0)
155
160
[181.82, 163.64, 145.45, 127.27, 109.09, 90.91, 72.73, 54.55, 36.36, 18.18]
0 commit comments