I made a function which will look up ages in a Dictionary and show the matching name:
Dictionary
dictionary = {\'george\' : 16, \'amber\' : 19} search_age
Sometimes int() may be needed:
titleDic = {'Фильмы':1, 'Музыка':2} def categoryTitleForNumber(self, num): search_title = '' for title, titleNum in self.titleDic.items(): if int(titleNum) == int(num): search_title = title return search_title