calculateur_inflation/inflation.py

12 lines
348 B
Python
Raw Normal View History

2024-12-03 08:59:19 -05:00
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