How can I convert a arbitrarily nested list of literals (string/numbers) to its string representation? For example,
nested_list = [[1,2,4],[1, [1, 2], [1]],2]
nested_list_string = "[[1,2,4],[1, [1, 2], [1]],2]"
Furthermore , it could be multilines:
[
1, 2,
[2,4]
]
can produces the string representation of equivalent single-line list i.e "[1,2, [2,4]]"
or any other equivalent form.