In: Computer Science
We will use El Paso information for our python script to compute property taxes for a home. We will default and use the Ysleta Independent School District tax rate for our school (more complete lookups will allow you to compute taxes based on exact address.) The taxing entities, and their respective tax rates per $100 is shown below:
Jurisdiction Total Rate ($) per $100
YSLETA ISD 1.3533
CITY OF EL PASO 0.907301
COUNTY OF EL PASO 0.488997
UNIVERSITY MEDICAL CENTER OF EL PASO 0.267747
EL PASO COMMUNITY COLLEGE 0.141167
Python Script Instructions: Create a loop that will allow the user to input a property value and calculate its related tax payment. Output property information as described below. The user will be asked to continue for another property or quit.
This will be a script broken into functions. It must include (may include more):
• Main function • Calculate property tax function
• Output information function called from Calculate function. Output will include the amount for each jurisdiction, and amount owed per year.
Other important information: We will assume each property value is eligible for a 10% Homestead Exemption of the property’s value. For example, if a property value is $100,000, the person would receive an exemption of $10,000. Their property taxes would be calculated on $90,000.
Don’t forget the rate is applied per $100 (i.e. you have to divide the amount for each jurisdiction you calculated by 100)
Sample calculation: Property value: $175,000 Yearly taxes owed: $4,974.66
Program:
Output:
Enter Property value: $175000
YSLETA ISD $2131.45
CITY OF EL PASO $1429.00
COUNTY OF EL PASO $770.17
UNIVERSITY MEDICAL CENTER OF EL PASO $421.70
EL PASO COMMUNITY COLLEGE $222.34
Yearly taxes owed: $4974.66
continue for another property or quit?quit
N.B. Whether you face any problem or need any modification then share with me in the comment section, I'll happy to help you.
Text version of code:
# function to calculate property tax def calculate_property_tax(val): exemption = 0.1 * val val = val - exemption y = 1.3533 * (val/100) city = 0.907301 * (val/100) country = 0.488997 * (val/100) umc = 0.267747 * (val/100) cc = 0.141167 * (val/100) tax = y + city + country + umc + cc output(y, city, country, umc, cc, tax) # function to display the information about property tax def output(y, city, country, umc, cc, tax): print('YSLETA ISD $%5.2f'%y) print('CITY OF EL PASO $%5.2f'%city) print('COUNTY OF EL PASO $%5.2f'%country) print('UNIVERSITY MEDICAL CENTER OF EL PASO $%5.2f'%umc) print('EL PASO COMMUNITY COLLEGE $%5.2f'%cc) print('Yearly taxes owed: $%5.2f'%tax)
f = '' while f != 'quit': val = int(input('Enter Property value: $')) calculate_property_tax(val) f = input('continue for another property or quit?')