def buildtag(tag,contents): """Create HTML with the given tag and contents. This function returns a string with the given HTML tag and contents. For example, >>> print buildtag("p", "Hello")

Hello

""" open = "<" + tag + ">" close = "" return open + contents + close # build the page's contents open = buildtag("h1","Page title") par1 = buildtag("p","This is the first paragraph.") # output the page (not valid HTML) print "Content-type: text/html" print print open + par1