I'm having a little bit of trouble with my code, it's returning a syntax error but I can't sort out where the problem is coming from. I've browsed the forums but haven't seen any topics related to my issue. If someone could tell me what I'm doing wrong and maybe help optimize some of my code, I would be greatly appreciative.
The lesson I'm in is notated in the title
Here's my code:
def hotel_cost(nights): return 140 * nights def plane_ride_cost(city): if city == "Charlotte": return 183 if city == "Tampa": return 220 if city == "Pittsburgh": return 222 if city == "Los Angeles": return 475 def rental_car_cost(days): if days <= 2 : return 40 * days elif days == 3 or days == 4 or days == 5 or days == 6: return 40 * days - 20 else days >= 7 : return 40 * days - 50
I'm getting the following error message:
File "python", line 19 else days >= 7 : ^ SyntaxError: invalid syntax
I thought I had proper indentation and use of parentheses, but I'm totally lost on what might be causing this.
Any help would be appreciated.