You can easily output to a desired number of decimal places,
print("["+", ".join(f"{el:.8f}" for el in ls)+"]")
using f-strings.
The value of getting the maximum number of visible decimal places is something you might want to consider carefully - it isn't obvious why you would do that in a simulated raw output like this. You can get a suitable number by a string analysis but it isn't pretty.
dp = 0
for el in ls:
op = str(el)
if "." in op:
dpi = len(op)-1 - op.find(".")
if dpi > dp: dp = dpi
print("["+", ".join(f"{el:.{dp}f}" for el in ls)+"]")