Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. def cout_location(type_voiture,nb_jours):
  2.  
  3.     # citadine
  4.     if type_voiture=="citadine" and nb_jours <=7 :
  5.         res = nb_jours * 30
  6.     if type_voiture=="citadine" and (nb_jours >7 and nb_jours <=14):
  7.         res = nb_jours * 27
  8.     if type_voiture=="citadine" and nb_jours >14 :
  9.         res = nb_jours * 25
  10.     # berline
  11.     if type_voiture=="berline" and nb_jours <= 7:
  12.         res =nb_jours * 35
  13.     if type_voiture=="berline" and (nb_jours >7 and nb_jours <14) :
  14.         res = nb_jours * 30
  15.     if type_voiture=="berline" and nb_jours > 14 :
  16.         res =nb_jours * 27
  17.     # utilitaire
  18.     if type_voiture=="utilitaire" and nb_jours <= 7:
  19.         res = nb_jours * 40
  20.     if type_voiture=="utilitaire" and (nb_jours >7 and nb_jours < 15 ):
  21.         res = nb_jours * 35
  22.     if type_voiture=="utilitaire" and nb_jours >=15 :
  23.         res = nb_jours * 30
  24.     # cabriolet
  25.     elif type_voiture=="cabriolet" and nb_jours > 0:
  26.         res = nb_jours * 80
  27.  
  28.     return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement