Human: What is a good Python code to code to replace data in a template text? Python code to replace text in a text template. Assistant: 
Here is a Python code to replace data in a template text

import sys

def replace_data(template, data):
    """Replace data in a template text."""
    return template.replace(data, "<b>%s</b>" % data)

# Enter the template text
template = "Hello <b>world</b>!"

# Enter the data
data = "Hello world!"

# Calling the function
print((replace_data(template, data)))

#Example Output
# Hello <b>world</b>!

#Remember to inspect code for bugs.