Say you have this list of floats assuming we have an even number of entries :
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
How could one turn this into this string :
[1.0, 2.0, 3.0][4.0, 5.0, 6.0]
If we had 10 elements we would have :
[1.0, 2.0, 3.0, 4.0, 5.0][6.0, 7.0, 8.0, 9.0, 10.0]
etc.
I tried :
list_to_str = ' '.join([str(e) for e in total_list])
final_str = '[' + list_to_str + ']'
But with this, the first '['
and the last ']'
are placed only at the beginning and at the end of the string... the middle ones are missing...