Checking if this code is right


Seems to work

Just checking if this is correct.

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


Your code is correct. I checked by calling your functions, which is a great way for you to check on your own as you work through problems in the future!

print hotel_cost(2) # 280
print hotel_cost(3) # 420

print plane_ride_cost('Tampa') # 220
print plane_ride_cost('Pittsburgh') # 222


I'll leave when I'm done with the code only have the option to save and
submit code or reset code I don't have an option to just test the code


You can print tests below your code anytime. It doesn't interfere with the Codecademy lessons.


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