6/7 stuck


Please help, I am stuck and I can't figure out what's wrong with my code

def hotel_cout(jours):
return 140*jours
#calcule le prix de l'hotel en fct du nbr de nuits

def avion_billet_cout(ville):
if ville == "Charlotte" :
return 183
elif ville == "Tampa" :
return 220
elif ville == "Pittsburgh" :
return 222
elif ville == "Los Angeles" :
return 475
#calcule le prix du billet d'avion en fct de la ville choisie

def location_voiture_cout(jours):
total_voiture = 40*jours
if jours >=7 :
total_voiture -=50
elif jours >=3 and jours <7 :
total_voiture -=20

    return total_voiture 
#calcule le prix de location de voiture en fct du nbr de jrs

def voyage_cout(ville,jours,depense_argent):

return hotel_cout(jours)+avion_billet_cout(ville)+location_voiture_cout(jours)+depense_argent

print voyage_cout("Tampa",5,50)

This is the error message that I get :
Oups, merci de réessayer.
Soyez sûr que voyage_cout prend exactement trois paramètres : ville, jours, et depense_argent (dans cet ordre).

I'm sorry it's in french but I can try to translate "Sorry, try again. Make sure voyage_cout takes exactly three parameters : ville, jours and depense_argent (in this order)"

Replace this line with your code.


The order in which your return statement should be in is,

return avion_billet_cout (ville ) + hotel_cout ( jours ) + location_voiture_cout ( jours ) + spending_money


Thanks for the quick response. I finally found my error :
I had to add spaces between the parameters of the last function

def voyage_cout(ville,jours,depense_argent): ==> (WRONG)
def voyage_cout(ville, jours, depense_argent): ==> (CORRECT)


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