Python-problem


#1

I have a problem with this:
After your previous code, print out the trip_cost( to “Los Angeles” for 5 days with an extra 600 dollars of spending money.

Don’t forget the closing ) after passing in the 3 previous values!

How cand I make it works?


#2

Are you using the correct call expression?

print trip_cost(“Los Angeles”, 5, 600)

#3

def trip_cost(Los Angeles, 5, 600):
print trip_cost(Los Angeles, 5, 600)
return rental_car_cost(5)+ hotel_cost(5)+ plane_ride_cost(Los Angeles)+ 600

This is what I wrote


#4

That line should not be inside the function. It will print the return value. Be sure to write the city in quotes (as a string)

The parameters are, (city, days, spending_money)


#5

But where?
I tried this:
def trip_cost(city, days, spending_money):
print trip_cost(“Los Angeles”, 5, 600)


#6
def trip_cost(city, days, spending_money):
    return ...

print trip_cost(“Los Angeles”, 5, 600)

#7

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