Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = input().split(">>")
- agency_income = []
- for vehicle in data:
- invalid_car = False
- details = vehicle.split(' ')
- type_car = details[0]
- year_car = int(details[1])
- kms_car = int(details[2])
- total_tax = 0
- if type_car == 'family':
- total_tax += 50
- total_tax -= 5 * year_car
- total_tax += (kms_car // 3000) * 12
- elif type_car == 'heavyDuty':
- total_tax += 80
- total_tax -= 8 * year_car
- total_tax += (kms_car // 9000) * 14
- elif type_car == 'sports':
- total_tax += 100
- total_tax -= 9 * year_car
- total_tax += (kms_car // 2000) * 18
- else:
- print('Invalid car type.')
- invalid_car = True
- agency_income.append(total_tax)
- if not invalid_car:
- print(f'A {type_car} car will pay {total_tax:.2f} euros in taxes.')
- print(f'Agency will collect {sum(agency_income):.2f} euros in taxes')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement