Added code for lecture 2026-11-10
This commit is contained in:
parent
5b630435ae
commit
07b9e54bf0
52 changed files with 1248 additions and 1 deletions
33
lecture20261110/lists/exciseTax04.py
Normal file
33
lecture20261110/lists/exciseTax04.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
message01 = '''
|
||||
Mass Excise Tax Fees
|
||||
====================
|
||||
|
||||
The tax depends on the vehicle age. For this program we only calculate the
|
||||
excise tax on the first year of purchase.
|
||||
https://www.sec.state.ma.us/divisions/cis/tax/motor-excise.htm
|
||||
|
||||
Vehicle Age Percentage of List Price
|
||||
In the year preceding the model year
|
||||
(brand new car released before model year) 50%
|
||||
In the model year 90%
|
||||
In the second year 60%
|
||||
In the third year 40%
|
||||
In the fourth year 25%
|
||||
In the fifth and succeeding years 10%
|
||||
'''
|
||||
print(message01)
|
||||
# Tax table for excise tax by year.
|
||||
exciseTaxRateTable = [.5, .9, .6, .4, .25, .10]
|
||||
|
||||
print("Length of tax table is ",len(exciseTaxRateTable))
|
||||
yearIndex = 0
|
||||
year = 2025
|
||||
|
||||
#
|
||||
while year >= 2001:
|
||||
if yearIndex > 5:
|
||||
yearIndex = 5
|
||||
print(f"{year:4d} {yearIndex:2d} {exciseTaxRateTable[yearIndex]}")
|
||||
yearIndex += 1 # Shorthand for yearIndex = yearIndex + 1
|
||||
year = year - 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue