starting 'sac a dos' problem

This commit is contained in:
2025-05-03 15:06:47 +02:00
parent c00b58e4ed
commit a8ee3a4989
3 changed files with 8 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
def change_render(p, price, given_money):
change = given_money - price
if change < 0:
raise Exception("the price cannot be greater than the given money")
else:
pos_m = [] # En gros ça donne les pièce inférieur au montant de change
pos_m = sorted([i for i in p if i <= change])
pos_t = []

View File

@@ -1,8 +0,0 @@
def change_render(p,price,given_money):
change = given_money - price
if change< 0:
raise Exception('the price cannot be greater than the given money')
else:
pos_m = [] # En gros ça donne les pièce inférieur au montant de change
pos_m = sorted([i for i in p if i <= change])
pos_t = []