# Transportation.... help!

#1

``````def costo_hotel(noches):
return 140 * noches
noches = 13

return 821
return 941
return 1280
return 1848
else:
return 0

def alquiler_de_auto(dias):
if dias >= 7:
descuento = 100
precio = 40 * dias - descuento
return precio
elif dias >= 3:
descuento = 50
precio = 40 * dias - descuento
return precio
else:
precio = 40 * dias
return precio``````

#2

A little more simplified...

``````def alquiler_de_auto(dias):
precio = 40 * dias
if dias >= 7:
precio -= 100
elif dias >= 3:
precio -= 50
else:
pass
return precio``````

#3

Parece que alquiler_de_auto retorna 40 en vez de el monto correcto (338) for 1 days

This code does pass...

``````def alquiler_de_auto(dias):
precio = 338 * dias
if dias >= 7:
precio -= 100
elif dias >= 3:
precio -= 50
else:
pass
return precio``````

#4

Thank´s that works i didn´t get what was the problem...

#5

Qué función tiene "-=" al colocarlo a la derecha de la variable precio?
Y porque no colocar unicamente "-" para restar el "descuento" de la variable precio?

#6

Search for `compound arithmetic operators` and `compound assignment operators`