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

23 lines
331 B
Python

f1 = open("City.txt")
cityDict = {}
for city in f1:
c = city.split(":")
#print(h)
cityDict.update({c[0]:c[1].strip()})
list1 = sorted(cityDict.items()) #sorting by city
print(list1)
f2 = open("Citysorted.txt","w")
for line in list1:
f2.write(str(line[0]+","+line[1]+"\n"))
f1.close()
f2.close()