<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_line(data, linestyle):
 """Formats a list of elements using the given line style"""

    return linestyle.begin + linestyle.sep.join(data) + linestyle.end