4/7 Did I define rental_car_cost


#1

Hey guys, feel like my syntax is right, no errors but I guess I'm not entering what they are looking for. Any tips?

py

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

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):


    cost = 40*days


    if days >= 7:


        return cost-50


    elif days >= 3:


        return cost-20


    elif days < 3:


        return cost

#2

Your formating got messed up, but it looks to me as if you defined rental_car_cost() inside of the definition of plane_ride_cost().

def plane_ride_cost(city):
    # ...
    def rental_car_cost(days):
        # ...

instead of

def plane_ride_cost(city):
    # ...
def rental_car_cost(days):
    # ...

#3

A post was split to a new topic: Rental car


#4