calculateur_inflation/smic.py

12 lines
339 B
Python
Raw Normal View History

2024-12-03 08:59:19 -05:00
content: str
with open("smic.txt") as f:
content = f.read()
def get_smic_data() -> dict[str: float]:
smic_data: dict[str: float] = {}
for line in content.splitlines():
year, _, _, _, _, value = line.split(" ")
value = value.replace(",", ".")
smic_data.update({year: float(value)})
return smic_data