10 lines
No EOL
262 B
Python
10 lines
No EOL
262 B
Python
def ajoute(stock,element,quantite):
|
|
if element in stock:
|
|
stock[element] = stock[element] + quantite
|
|
else:
|
|
stock[element] = quantite
|
|
|
|
stock = { 'clous': 14, 'vis': 27, 'boulons': 8,
|
|
'écrous': 24 }
|
|
ajoute(stock,'vis',5)
|
|
ajoute(stock,'chevilles',3) |