Taking a Vacation Transportation


#1



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


Oops, try again. Your code looks a bit off. Feel free to peek back at earlier exercises if you need a refresher! Your code threw the following error: invalid syntax (python, line 17)


I don't see where the code is going wrong, as stated in the error message its something wrong with line 17, but I can't figure out what.


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
def rental_car_cost(days):
    total=days*40
    return total
    if days>=7:
        total=total-50
    elif days>=3 or days>=7
        total=total-20
    return total

Thanks


#2

you are missing a colon at the end of line 17


#3

Also, you have a return statement inside of your rental_car_cost() which stops your code before it evaluates the days.


#4

i saw that, but i actually only wanted to help with the current issue, hoping that the learner could find the next issue on his own, increasing learning and debug experience


#5

Ahh, sorry. Didn't mean to spoil the surprise.


#6

you couldn't have known, its not to blame you. I mean, sometimes i actually miss things. The cat is out of the bag (can i say this?) its good for other people reading the topic


#7

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