-
@ Trust
2025-03-31 05:00:00def create_basic_html(title, heading, paragraph): """ Creates a simple HTML string.
Args: title: The title of the HTML page. heading: The main heading of the page. paragraph: A paragraph of text for the page.
Returns: A string containing the HTML code. """
html_string = f"""
{title} {heading}
{paragraph}
""" return html_string
Example usage:
my_title = "My First Webpage" my_heading = "Welcome!" my_paragraph = "This is a simple webpage created with Python."
my_html = create_basic_html(my_title, my_heading, my_paragraph)
To save to a file (optional):
with open("my_page.html", "w") as f: f.write(my_html)
print("HTML created! (Check 'my_page.html' in the same folder as this python code)")