I am learning Python through codeacademy and I am stuck in this tutorial :
My code is:
def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(city):
if city == "Charlotte":
return 183
if city == "Tampa":
return 220
if city == "Pittsburgh":
return 222
if city == "Los Angeles":
return 475
def rental_car_cost(days):
return 40 * days
if days >= 7:
return days - 50
elif days >= 3:
days - 20
return days
return days
Sorry for disabling code locks. Anyway, I get this error when I run the code: "Oh, try again. It seems that rent_car_cost returns 120 instead of the correct amount (100) for 3 days."
This tells me that this happens around elif> = 3 days: but not sure any help would be great!
source
share