For data storage purposes I am trying to recover lists of floats from a .txt file. From the string like:
a = \'[1.3, 2.3, 4.5]\'
I want to recover:<
well if you are sure that your input data is of type, a = '[1.3, 2.3, 4.5]' then you could use the eval command and assign it to same or a different variable.
a = '[1.3, 2.3, 4.5]' b=eval(a) print(b.__class__) # to know if b is of type list or not