Solve bug which removed the first personn in accound
This commit is contained in:
parent
bccea81276
commit
7c093fa481
4
pralo.py
4
pralo.py
@ -49,7 +49,6 @@ def extrait_from_file(file_name):
|
|||||||
compte["jours"] = int(c[i])
|
compte["jours"] = int(c[i])
|
||||||
comptes += [compte]
|
comptes += [compte]
|
||||||
|
|
||||||
print(comptes)
|
|
||||||
return comptes
|
return comptes
|
||||||
finally:
|
finally:
|
||||||
file.close()
|
file.close()
|
||||||
@ -120,6 +119,7 @@ def forfait(compte):
|
|||||||
new_compte = []
|
new_compte = []
|
||||||
for pers in compte:
|
for pers in compte:
|
||||||
new_compte += [[pers["nom"], (pers["montant"] - pers["jours"] * cout_jour)]]
|
new_compte += [[pers["nom"], (pers["montant"] - pers["jours"] * cout_jour)]]
|
||||||
|
|
||||||
return new_compte
|
return new_compte
|
||||||
|
|
||||||
def normalise(compte):
|
def normalise(compte):
|
||||||
@ -157,7 +157,7 @@ if __name__ == '__main__':
|
|||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if options.file_name:
|
if options.file_name:
|
||||||
compte = extrait_from_file(options.file_name)[1:]
|
compte = extrait_from_file(options.file_name)
|
||||||
# compte_normalise = normalise(compte)
|
# compte_normalise = normalise(compte)
|
||||||
compte_normalise = forfait(compte)
|
compte_normalise = forfait(compte)
|
||||||
final = echange(compte_normalise, options.seuil)
|
final = echange(compte_normalise, options.seuil)
|
||||||
|
Loading…
Reference in New Issue
Block a user