first commit
This commit is contained in:
14
repertoire_web.py
Normal file
14
repertoire_web.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Créé par alban.beltran, le 16/02/2026 en Python 3.7
|
||||
# repertoire_web.py
|
||||
_repertoire = {
|
||||
"Alice": "0600000001",
|
||||
"Bob": "0600000002"
|
||||
}
|
||||
|
||||
def rechercher(nom: str) -> str:
|
||||
"""Renvoie le numéro si le nom existe, sinon 'Inconnu'."""
|
||||
return _repertoire.get(nom, "Inconnu")
|
||||
|
||||
def ajouter(nom: str, numero: str) -> None:
|
||||
"""Ajoute ou remplace une entrée du répertoire."""
|
||||
_repertoire[nom] = numero
|
||||
Reference in New Issue
Block a user