fork download
  1. def writeDocument(title, paragraph):
  2. return "<!DOCTYPE html>\n%s\n\n%s\n</html>" % (writeHead(title), writeParagraph(paragraph))
  3.  
  4.  
  5. def writeHead(title):
  6. return "\t<head>\n\t\t<title>\n\t\t\t%s\n\t\t</title>\n\t</head>" % (title)
  7.  
  8. def writeParagraph(paragraph):
  9. return "\t<body>\n\t\t<p>\n\t\t\t%s\n\t\t</p>\n\t</body>" % (paragraph)
  10.  
  11. title = raw_input("Please enter the title for your HTML document: ")
  12. paragraph = raw_input("Please enter the paragraph for your HTML document:\n")
  13.  
  14. print writeDocument(title, paragraph)
Success #stdin #stdout 0.01s 7900KB
stdin
Kobe
Page all about Kobe Bryant!
stdout
Please enter the title for your HTML document: Please enter the paragraph for your HTML document:
<!DOCTYPE html>
	<head>
		<title>
			Kobe
		</title>
	</head>

	<body>
		<p>
			Page all about Kobe Bryant!
		</p>
	</body>
</html>