Un commerce de location de trottinette, avec le tarif suivant : * forfait pour la location : 5 € (hors-taxes) ; * 13 centimes d’€ (h.-t.) par heure commencée ; * taux de T.V.A. 20,6 %. Le logiciel établit les factures pour cinq clients.
#!/usr/bin/env python3 # fichier: trottinette.py # auteur: Pascal Chauvin # date: 2019/01/22 """ commerce de location de trottinettes """ def calcul_facture(client): print(client) n = float(input("nombre d'heures ? ")) a_payer = (5 + n*0.13) * 1.206 print("EU {:7.2f}\n".format(a_payer)) for client in ["A", "B", "C", "D", "E"]: calcul_facture(client)