def to_tuple(expression):
    """ Convert nested list to nested tuple """
    my_tup=tuple()
    for elem in expression:
        if type(elem)!=list:
            my_tup=my_tup+tuple([elem])
        else:
            my_tup=my_tup+tuple([to_tuple(elem)])
    return (my_tup)