I have a string in my python
like:
str = "[3705049, 3705078, 3705082, 3705086, 3705093, 3705096]"
Now I need to convert it to an array or list like:
arr = [3705049, 3705078, 3705082, 3705086, 3705093, 3705096]
I have tried like this:
str = "[3705049, 3705078, 3705082, 3705086, 3705093, 3705096]"
arr = list(str)
print(arr)
But it provides output like this:
['[', '3', '7', '0', '5', '0', '4', '9', ',', ' ', '3', '7', '0', '5', '0', '7', '8', ',', ' ', '3', '7', '0', '5', '0', '8', '2', ',', ' ', '3', '7', '0', '5', '0', '8', '6', ',', ' ', '3', '7', '0', '5', '0', '9', '3', ',', ' ', '3', '7', '0', '5', '0', '9', '6', ']']
Please suggest how can I fix this?