<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_json(filename, data):
 """ Write data to JSON file :param filename: name of JSON file to write data to :type filename: str :param data: data to write to JSON file :type data: list, tuple """

    with open(filename, 'w') as file:
        json.dump(data, file, indent=4, sort_keys=True)