Transportation...Please help


#1



https://www.codecademy.com/courses/python-beginner-P5YtY/1/3?curriculum_id=4f89dab3d788890003000096#


Your code threw the following error: invalid syntax (python, line 18)

File "python", line 18
return total -= 20
^
SyntaxError: invalid syntax


What am I doing wrong :cry: :crying_cat_face: :cry:


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
    elif city == "Los Angeles": 
        return 475
    
def rental_car_cost(days):
    if car >= 7:
        total -= 50
    elif car >= 3:
        return total -= 20
        return cost


#2

you can't update a variable and return it on the same line


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.