code: def make_html_tag(tag, text=None, **params):
      
      params_string = ""
  
      # Parameters are passed. Turn the dict into a string like "a=1 b=2 c=3" string.
      for key, value in sorted(params.items()):
          # Strip off a leading underscore from the attribute's key to allow attributes like '_class'
          # to be used as a CSS class specification instead of the reserved Python keyword 'class'.
          key = key.lstrip("_")
  
          params_string += u' {0}="{1}"'.format(key, value)
  
      # Create the tag string
      tag_string = u"<{0}{1}>".format(tag, params_string)
  
      # Add text and closing tag if required.
      if text:
          tag_string += u"{0}</{1}>".format(text, tag)
  
      return tag_string
docs: Create an HTML tag string.
  
      tag
          The HTML tag to use (e.g. 'a', 'span' or 'div')
  
      text
          The text to enclose between opening and closing tag. If no text is specified then only
          the opening tag is returned.
  
      Example::
          make_html_tag('a', text="Hello", href="/another/page")
          -> <a href="/another/page">Hello</a>
  
      To use reserved Python keywords like "class" as a parameter prepend it with
      an underscore. Instead of "class='green'" use "_class='green'".
  
      Warning: Quotes and apostrophes are not escaped.