<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addslashes(s, escaped_chars=None):
 """Add slashes for given characters. Default is for ``\`` and ``'``. :param s: string :param escaped_chars: list of characters to prefix with a slash ``\`` :return: string with slashed characters :rtype: str :Example: "\\'" """

    if escaped_chars is None:
        escaped_chars = ["\\", "'", ]

    # l = ["\\", '"', "'", "\0", ]
    for i in escaped_chars:
        if i in s:
            s = s.replace(i, '\\' + i)
    return s