0
list_of_numbers = []

numbers = "[2.0, 3.0, 4.0, 5.0, 6.0, -1.0, -10.0, 10.0]"
quamrana
  • 37,849
  • 12
  • 53
  • 71
Curry boy
  • 1
  • 1

1 Answers1

1

Assuming that you want to convert the string representation of the list to a proper list, do this:

import ast
numbers = "[2.0, 3.0, 4.0, 5.0, 6.0, -1.0, -10.0, 10.0]"
list_of_numbers=list(ast.literal_eval(numbers))
print (list_of_numbers)