Tirando Férias


#1

def hotel_cost (nights):
      return * 140 nights
hotel_cost print (10)
def plane_ride_cost (city):
     if city == "Charlotte":
       return 183
     elif city == "cover":
       return 220
     elif city == "Pittsburgh":
      return 222
     else:
      city == "Los Angeles"
      return 475
def rental_car_cost (days):
     cost = 40 days *
     if days> 7 days or == 7:
      return cost -50
     elif days> 3 days or == 3:
      return cost -20
     else:
      return cost
print rental_car_cost (1)

o erro aqui desta vez para somar o custo total de sua viagem é reunir todas as funções anteriores quem pode dizer o erro

def trip_cost (city, days):
      return rental_car_cost (days) + hotel_cost (days) + plane_ride_cost (city)
def hotel_cost (nights):
      return rental_car_cost (nights) + hotel_cost (nights)

#2

def hotel_cost (nights):
return * 140 nights
seria return 140*nigths
o print deu erro ,pois seria
print (hotel_cost(10)) isso se você tentou testar sua função.
cost = 40 days * seria
cost = 40 * days
if days> 7 days or == 7:
seria if days>=7:
if days> 3 days or == 3
seria if days>=3:
e no final deu ruim pq vc esqueceu o parentese do print()

o meu fico assim :
def hotel_cost(nigths):
return 140*nigths
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):
x = 40
if days >=7 :
return (days*x)-50
elif days >=3 :
return (days*x)-20
else :
return days*x
def trip_cost(city,days):
return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days)


#4