Use of Dates in Python [closed]

-1

I am carrying out a program that allows calculating the taxes that a car must pay, knowing its model (year of manufacture) and type (P: Private / T: Taxi / R: Remis). To calculate taxes, keep in mind that:

a. Private cars less than 10 years old pay $ 200, between 10 and 20 years pay $ 150 and do not pay taxes those who are over 20 years old.

b. Taxis pay taxes as a private car, plus $ 150 for the taxi license.

c. Remises pay $ 100 for each year of their vehicle's seniority.

For this I need to obtain the age of the vehicle from its year of manufacture

what is the way to handle dates in python?

    
asked by Oscar Angulo 11.04.2017 в 02:47
source

1 answer

0
from datetime import date

antique=date.today().year-modelo

    if antique> 20:
       impuesto=0
    elif antique>10:
       impuestos=150
    elif:
       impuestos=200

    if tipo=='t':
     impuestos+=150
    elif tipo=='r':
     impuestos=antique*100
    
answered by 11.04.2017 / 03:20
source