Pleas help


#1



transportation

File "python", line 16
elif days>=3:
^
SyntaxError: invalid syntax


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):
    cost= 40*days
    if days>=7:
        cost-=50
        elif days>=3:
            cost-=20
        return cost

Replace this line with your code.


#2

def rental_car_cost(days):
    cost= 40*days
    if days>=7:
        cost-=50
        elif days>=3:
            cost-=20
        return cost

Indent your code properly!

hint**

def anyfunction():
    if condition1:
        #your code
    elif condition2:
        #your code
    else:
       #yourcode

last return statement should be indented at same level asif-elif-else statement.


#3

thanks...figured it out already
now i'm stuck here:
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):
cost= 40*days
if days>=7:
cost-=50
elif days>=3:
cost-=20
return cost
def trip_cost(city,days,spending_money):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)+spending_money
print trip_cost(city,days,spending_money)


#4

the error is
oops seems like nothing was printed to the console


#5

hey @coderunner79142

print trip_cost(city,days,spending_money)

You need to pass actual arguments to trip_cost() fucntion!
like city "Tampa"
days 4 etc


#7

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