print("Sistema de transporte")
try:
edad = int(input("Ingrese la edad del pasajero: "))
km = int(input("ingrese cantidad de km a recorrer: "))
mayor = edad >= 18
medios = edad > 6 and edad < 18
kilometros = km <= 20
if edad > 0 and km > 0:
if (medios):
if kilometros:
print("$1.5")
else:
print("$2.50")
elif(mayor):
if kilometros:
print("2.50")
else:
print("$4.00")
else:
print("por ser menor a 6 años viaja gratis.")
else:
print("Los valores para edad y km deben ser mayor a 0.")
except Exception as e:
print(f"ocurrio un error inesperado: {e}")