@@ -98,6 +98,17 @@ def declining_balance_depreciation(useful_years: int,
98
98
:param purchase_value: Purchase expenditure for the asset
99
99
:param residual_value: Residual value of the asset at the end of its useful life
100
100
:return: A list of annual depreciation expenses over the asset's useful life
101
+
102
+ >>> declining_balance_depreciation(10,1100.0,100.0)
103
+ [234.52721358355052, 184.52447366421927, 145.1826458038188, 114.22875363922134, 89.87443427365002, 70.71261550765269, 55.636222162002895, 43.774214745666626, 34.44126509920373, 27.098161521014077]
104
+ >>> declining_balance_depreciation(6,1250.0,50.0)
105
+ [518.9955654467834, 303.51044788404226, 177.49398666917426, 103.79911308935672, 60.70208957680846, 35.49879733383485]
106
+ >>> declining_balance_depreciation(4,1001.0)
107
+ [1001.0, 0.0, 0.0, 0.0]
108
+ >>> declining_balance_depreciation(11,380.0,50.0)
109
+ [63.98359103909348, 53.21017019104619, 44.25075501045555, 36.799907084771036, 30.60361707111676, 25.45064517902371, 21.165319724245478, 17.601548246751307, 14.637837023922344, 12.173149187513005, 10.123460242061142]
110
+ >>> declining_balance_depreciation(1,4985,100)
111
+ [4885.0]
101
112
"""
102
113
103
114
if not isinstance (useful_years , int ):
@@ -139,6 +150,17 @@ def sum_of_years_digits_depreciation(useful_years: int,
139
150
:param purchase_value: Purchase expenditure for the asset
140
151
:param residual_value: Residual value of the asset at the end of its useful life
141
152
:return: A list of annual depreciation expenses over the asset's useful life
153
+
154
+ >>> declining_balance_depreciation(10,1100.0,100.0)
155
+ [234.52721358355052, 184.52447366421927, 145.1826458038188, 114.22875363922134, 89.87443427365002, 70.71261550765269, 55.636222162002895, 43.774214745666626, 34.44126509920373, 27.098161521014077]
156
+ >>> declining_balance_depreciation(6,1250.0,50.0)
157
+ [518.9955654467834, 303.51044788404226, 177.49398666917426, 103.79911308935672, 60.70208957680846, 35.49879733383485]
158
+ >>> declining_balance_depreciation(4,1001.0)
159
+ [1001.0, 0.0, 0.0, 0.0]
160
+ >>> declining_balance_depreciation(11,380.0,50.0)
161
+ [63.98359103909348, 53.21017019104619, 44.25075501045555, 36.799907084771036, 30.60361707111676, 25.45064517902371, 21.165319724245478, 17.601548246751307, 14.637837023922344, 12.173149187513005, 10.123460242061142]
162
+ >>> declining_balance_depreciation(1,4985,100)
163
+ [4885.0]
142
164
"""
143
165
144
166
if not isinstance (useful_years , int ):
@@ -171,10 +193,6 @@ def sum_of_years_digits_depreciation(useful_years: int,
171
193
return list_of_depreciation_expenses
172
194
173
195
174
-
175
-
176
-
177
196
if __name__ == "__main__" :
178
197
import doctest
179
-
180
- doctest .testmod ()
198
+ doctest .testmod ()
0 commit comments