def format_for_IN(l):
    """ Converts input to string that can be used for IN database query """
    
    if type(l) is tuple:
        l = list(l)
    if type(l) is str:
        l = [l]

    return "(" + ','.join(['"' + str(x) + '"' for x in l]) + ")"