Checking if this code is right


#1



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


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


#2

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

#3

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


#4

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


#5

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