Help with the renting of a Car


#1

What is wrong with my code?

def hotel_cost(nights):
nights == nights
return 140 * nights
def plane_ride_cost(city):
if city == "Charlotte":
return 183
elif city == "Tampa":
return 220
elif city == "Pittsburgh":
return 222
elif city == "Los Angeles":
return 475
def rental_car_cost(days):
cost = 40 * days
if days >= 7:
cost -= 50
elif days >= 3:
cost -= 20
else:
return cost

plz help


#2

Hi, @pinestwin2,

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.

The following statement does not do any useful work; it tests whether nights is equivalent to nights, which is always True, but does nothing with the result ...

nights == nights

That statement should be removed, but it is not really a problem. To identify the actual problem, we must be able to look at the indentation in your code, so it needs to be formatted.