Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python 3 Part Il: HTML Stylizer (20 points) Write a function insert.tag) that ta

ID: 3603312 • Letter: P

Question

Python 3

Part Il: HTML Stylizer (20 points) Write a function insert.tag) that takes the following arguments, in this order: 1. input.filename: the name of an HTML file the function will process 2. output.filename: the name of an output file that will contain processed HTMLcode 3. tag: an HTML tag that will be used to stylize particular words in the original file 4. target.word: the targeted word that the function finds and stylizes using the tag You don't actually need to know HTML to solve this problem. Here's an example of what the function is supposed to do. Say this the content in your original HTML file: I Like Python p>I love Python, because Python is awesome! I love Python yay! p>This paragraph should remain unchanged. /body>

Explanation / Answer

def insert_tag(input_filename, output_filename, tag, target_word): pass if __name__ == '__main__': print("Testing Part II") print("Reminder: please compare your output file with the 'expectedX.html' files provided for you.") print("Testing insert_tag() with input_filename = 'sample1.html', output_filename = 'modified1.html', " + "tag = 'i', target_word = 'Python'") insert_tag('sample1.html', 'modified1.html', 'i', 'Python') print("Testing insert_tag() with input_filename = 'sample2.html', output_filename = 'modified2.html', " + "tag = 'b', target_word = 'buffalo'") insert_tag('sample2.html', 'modified2.html', 'b', 'buffalo') print("Testing insert_tag() with input_filename = 'sample3.html', output_filename = 'modified3.html', " + "tag = 'u', target_word = 'Stony'") insert_tag('sample3.html', 'modified3.html', 'u', 'Stony') print()