Getting There bug


#1



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


The error message is:
Oops, try again. Make sure plane_ride_cost takes exactly one input (city).
But I don't understand what is even the issue here.


def hotel_cost(nights):
    return 140 * nights
def plane_ride_cost(city):
    if city == "Charlotte":
        return city + 183
    elif city == "Tampa":
        return city + 220
    elif city == "Pittsburgh":
        return city + 222
    elif city == "Los Angeles":
        return city + 475


#2

Problem.

if city == "Charlotte":
        return city + 183

You're trying to add string with number . This throws an error!
and same being repeated in other lines of code.

Let me ask a questions, suppose if city is Texas ,If you go Tesax It will cost 300 bucks.
How do You write it using function

if city == "Tesax":
        return 300

#3

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