Why wont this code run? No one can tell me so far.
Lines 20 through 24 are not needed for excersize 4/7
also you need an
else: return cost
after the return cost - 20 so if you stay for less than 3 days it will give you the regular cost
can you x out of that error so i can see the rest of the code
if city == "Charlotte":
elif city == "Tampa":
elif city == "Pittsburgh":
elif city == "Los Angeles":
this is what I put and it worked
cost = days*40
if days >= 7:
cost -= 50
elif days >= 3:
cost -= 20
Hi @mananjain0220 ,
Let us see the remainder of your code, as @ryebread4 asks.
In the meantime, you need to fix the indentation. In the
if structure within the
plane_ride_cost function, you only indented the
return statements by one space past the block headers. While this did not cause the error, you should go four spaces past the block headers instead.
Line 15 in the
rental_car_cost function is indented by seven spaces, when it should be four. That is why you got an error regarding line 16. That line is indented by the right amount, but caused an error because it does not match line 15.