This repository has been archived on 2025-12-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-09-20 14:17:13 +03:00

25 lines
524 B
Python

import matplotlib.pyplot as plt
lst1 = []
lst2 = []
def cityPopulationChart(txt):
dct = {}
with open(txt, 'r') as f:
con = f.readlines()
for i in con:
i = i.split(',')
i = [x.replace('\n', '') for x in i]
lst1.append(i[0])
lst2.append(int(i[1]))
#dct[i[0]] = int(i[1])
years = lst1
pop = lst2
plt.plot(years, pop)
plt.xlabel('Years')
plt.ylabel('Population')
plt.show()
cityPopulationChart('citypopulation.txt')