Showing error in syntax


showing invalid syntax at line 24

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):
 if days>=7:
        return Cost-=50
 elif days>=3:
        return Cost-=20
 elif days>=1:
      return Cost

Replace this line with your code.


Have a look at here:

if days>=7:
    return Cost-=50

Cost -= 50 is a shorter way to type Cost = Cost - 50, and you can't do that when you return value of a function, right? :slight_smile:


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