Damn! i don't know what to do now 4/7


#1

def rental_car_cost(days):
cost = days * 40
if days >= 7:
cost - 50
elif days >= 3:
cost - 20
return cost


#2

Hi, @jacksonxu1,

Because your code is not formatted, it is difficult for other users to read and debug it. As code is being posted, you can format it by selecting it, and then by clicking the </> button above the editing area. This will enable us to see important details, such as the indentation and underscores.

Assuming the actual indentation is correct, the problems are here ...

cost - 50

... and here ...

cost - 20

Those are valid expressions, but they do not change the value of cost. This type of syntax will accomplish the task ...

cost -= 50

#3

def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(city):
if city == "Charlotte":
return 183
elif city == "Tampa":
return 220
elif city == "Pittsburgh":
return 222
else:
return 475
plane_ride_cost("Tampa")

def rental_car_cost(days):
totalcost = 40 * days
if days >= 7:
return totalcost - 50
elif days >= 3:
return totalcost - 20
else:
return totalcost