Taking a Vacation, 7.plan your trip


#1

How about it ?

def hotel_cost(nights):
    return 140 * nights
def plane_ride_cost(string):
    if string == "Charlotte":
        return 183
    elif string == "Tampa":
        return 220
    elif string == "Pittsburgh":
        return 222
    elif string == "Los Angeles":
        return 475
    else:
        return "None"
def rental_car_cost(days):
    costs = 40 * days
    if days >= 7:
        costs -= 50
    elif days >= 3:
        costs -= 20
    return costs
def trip_cost(city, days, spending_money):
    trip_cost = plane_ride_cost(city) + hotel_cost(days) + rental_car_cost(days) + spending_money
    return trip_cost
    print trip_cost("Los Angeles", 5, 600)

i have to print the trip_cost("Los Angeles", 5 ,600) but the code is eror


#4

I copied your code
Finally had it

OUR QUESTIONS ARE INTERCHANGED
THIS SHOULD BE YOUR QUESTION (MAYBE)

Below your existing code, define a function called rental_car_cost with an argument called days.
Calculate the cost of renting the car:
Every day you rent the car costs INR 2,689.
if you rent the car for 7 or more days, you get INR 3,361 off your total.
Alternatively (elif), if you rent the car for 3 or more days, you get INR 1,344 off your total.
You cannot get both of the above discounts.
Return that cost.