def startswith(string, prefixes):
    """Checks if str starts with any of the strings in the prefixes tuple.
    Returns the first string in prefixes that matches. If there is no match,
    the function returns None.
    """
    if isinstance(prefixes, tuple):
        for prefix in prefixes:
            if string.startswith(prefix):
                return prefix
        return None
    elif isinstance(prefixes, str):
        prefix = prefixes
        if string.startswith(prefix):
            return prefix
        return None
    else:
        raise Exception('Second argument must be string or a tuple of strings.')