Pulling it together


#1

](https://www.codecademy.com/courses/python-beginner-P5YtY/1/4?curriculum_id=4f89dab3d788890003000096)

File "python", line 22
def trip_cost('Tampa',8):
^
SyntaxError: invalid syntax

they are saying that a single quote


def hotel_cost(days):
    return 140 * days
    
def plane_ride_cost(city):
    if city == "Charlotte":
        return 183
    elif city == "Tampa":
       return 220
    elif city == "Pittsburgh":
        return 222
    else:
        return 475

def rental_car_cost(days):
    total = days * 40
    if days >= 7:
        total -= 50
    elif days >= 3:
        total -= 20
    return total

def trip_cost('Tampa',8):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)


#2

The arguments for the trip_cost function don't need to be passed through yet. Try this instead:

def trip_cost(city, days):
      return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)

#3

ok i'll try that thanks


#4

thanks so much i've been struggling for ages and kept on thinking that it was wrong


#5

can someone help me my code is a little off but im not sure whats wrong. thanks!

def trip_cost(city, days):
    return (rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)

#7

This discussion is to help @acodster

I would be happy to answer your question, @bushmonkey09 , however you need to first make a new topic and post your discussion there.


#8

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