程序代写代做代考 Exercise 6-11 Personal Web Page Generator
Exercise 6-11 Personal Web Page Generator
def main():
name = input(‘Enter your name: ‘)
description = input(‘Describe yourself: ‘)
# Create the file.
html_file = open(‘my_page.html’, ‘w’)
# Write the HTML
write_html(html_file, name, description)
# Close the file.
html_file.close()
def write_html(html_file, name, description):
# Write the tag.
html_file.write(‘
’)
# Write the
element.write_head(html_file)
# Write the body.
write_body(html_file, name, description)
# Write the tag.
html_file.write(‘
’)
def write_head(html_file):
html_file.write(‘
’)
html_file.write(‘
’)
html_file.write(‘
’)
def write_body(html_file, name, description):
html_file.write(‘
’)
html_file.write(‘
’)
html_file.write(‘
‘)
html_file.write(name)
html_file.write(‘
’)
html_file.write(‘
’)
html_file.write(‘
’)
html_file.write(description)
html_file.write(‘
’)
html_file.write(‘
’)
main()