code: def string_format(msg, method):
      
      if method == "uppercase":
          return msg.upper()
      elif method == "lowercase":
          return msg.lower()
      elif method == "sentence":
          return msg.capitalize()
      elif method == "formal":
          return string.capwords(msg)
docs: Format a string (upper, lower, formal, sentence).
  
      :param str msg: The user's message.
      :param str method: One of ``uppercase``, ``lowercase``,
          ``sentence`` or ``formal``.
  
      :return str: The reformatted string.