code: def plural(text):
      
      aberrant = {
          'knife': 'knives',
          'self': 'selves',
          'elf': 'elves',
          'life': 'lives',
          'hoof': 'hooves',
          'leaf': 'leaves',
          'echo': 'echoes',
          'embargo': 'embargoes',
          'hero': 'heroes',
          'potato': 'potatoes',
          'tomato': 'tomatoes',
          'torpedo': 'torpedoes',
          'veto': 'vetoes',
          'child': 'children',
          'woman': 'women',
          'man': 'men',
          'person': 'people',
          'goose': 'geese',
          'mouse': 'mice',
          'barracks': 'barracks',
          'deer': 'deer',
          'nucleus': 'nuclei',
          'syllabus': 'syllabi',
          'focus': 'foci',
          'fungus': 'fungi',
          'cactus': 'cacti',
          'phenomenon': 'phenomena',
          'index': 'indices',
          'appendix': 'appendices',
          'criterion': 'criteria',
  
  
      }
  
      if text in aberrant:
          result = '%s' % aberrant[text]
      else:
          postfix = 's'
          if len(text) > 2:
              vowels = 'aeiou'
              if text[-2:] in ('ch', 'sh'):
                  postfix = 'es'
              elif text[-1:] == 'y':
                  if (text[-2:-1] in vowels) or (text[0] in string.ascii_uppercase):
                      postfix = 's'
                  else:
                      postfix = 'ies'
                      text = text[:-1]
              elif text[-2:] == 'is':
                  postfix = 'es'
                  text = text[:-2]
              elif text[-1:] in ('s', 'z', 'x'):
                  postfix = 'es'
  
          result = '%s%s' % (text, postfix)
      return result
docs: >>> plural('activity')
          'activities'