code: def capfirst(x):
      '''Capitalise the first letter of ``x``.
      '''
      x = to_string(x).strip()
      if x:
          return x[0].upper() + x[1:].lower()
      else:
          return f capfirst(x):
      '''Capitalise the first letter of ``x``.
      '''
      x = to_string(x).strip()
      if x:
          return x[0].upper() + x[1:].lower()
      else:
          return x
docs: Capitalise the first letter of ``x``.