It wont work


#1
def hotelcost(nights):
return 140 * nights
def planeridecost(city):
if city == "Charlotte" :
return 183
elif city == "Tampa" :
return 220
elif city == "Pittsburgh" :
return 222
elif city == "Los Angeles" :
return 475
def rentalcarcost(days):
cost = days * 40
if days >= 7:
cost -= 50
elif days >= 3:
cost -= 20
return cost
def tripcost(city,days):
return rentalcarcost(days) + hotelcost(days) + planeride_cost(city)

#2

No wonder why it won't work you do not have proper indentation. White space is 100% critical to Python.


#3

can you show me please? @zeziba


#4

@flyingdestruction

It should look more like

def hotelcost(nights):
    return 140 * nights
def planeridecost(city):
    if city == "Charlotte" :
        return 183
    elif city == "Tampa" :  
        return 220
    elif city == "Pittsburgh" :
        return 222
    elif city == "Los Angeles" :
        return 475
def rentalcarcost(days):
    cost = days * 40
    if days >= 7:
        cost -= 50
    elif days >= 3:
        cost -= 20
    return cost
def tripcost(city,days):
    return rentalcarcost(days) + hotelcost(days) + planeride_cost(city)

Now this is just your code indented properly, you still have to go through and fix your errors.