Sketched such a code
from collections import Counter counter = Counter() with open('work.txt') as file: for line in file: if line.strip(): # skip blank lines name, money = line.split() counter[name] = int(int(money)*0.25+(int(money))) for name, money in counter.most_common(): print(name, money) It collects employee data from a file. Here's what's in the file:
Лужков 10000 Измайлов 11000 Васьков 13000 Дмитриев 12000 Гуськов 7000 Increases money value by 25% and displays. All is well. but how to sort alphabetically?
counter[name] = int(money)*5//4- jfs