calculateur_inflation/inflation.py
2024-12-03 14:59:19 +01:00

12 lines
348 B
Python

content: str
with open("inflation.txt") as f:
content = f.read()
def get_inflation_data() -> dict[str: float]:
inflation_data: dict[str: float] = {}
for line in content.splitlines():
year, value, _ = line.split(" ")
value = value[:-1]
inflation_data.update({year: float(value) / 100})
return inflation_data