您现在的位置是:首页 > 房产 > 正文

ntax_rates = ["1.2%", "4%", "12%"]

发布时间:2025-04-08 23:41:42慕容茗娜来源:

导读 property_tax_rates = {"residential": "1.2%", "commercial": "4%", "luxury": "12%"} Function to calculate property taxde...

property_tax_rates = {"residential": "1.2%", "commercial": "4%", "luxury": "12%"}

Function to calculate property tax

def calculate_property_tax(property_type, value):

if property_type not in property_tax_rates:

return "Invalid property type"

tax_rate = float(property_tax_rates[property_type])

tax_amount = value (tax_rate / 100)

return round(tax_amount, 2)

Example usage

residential_tax = calculate_property_tax("residential", 500000)

commercial_tax = calculate_property_tax("commercial", 300000)

luxury_tax = calculate_property_tax("luxury", 1000000)

print(f"Residential Property Tax: ${residential_tax}")

print(f"Commercial Property Tax: ${commercial_tax}")

print(f"Luxury Property Tax: ${luxury_tax}")

标签:

上一篇
下一篇