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:
        >>> addslashes("'")
        "\\'"
    """
    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