0

Say the string is like a = "['Hello', 'World']". After the conversion, a = ['Hello', 'World'] and the type is a list.

petezurich
  • 9,280
  • 9
  • 43
  • 57
KevinTran
  • 25
  • 9

1 Answers1

-1

It's called expression evaluation. Read about Python's eval() and literal_eval().

Notice that it may be dangerous, so read the docs carefully.

Dennis
  • 2,271
  • 6
  • 26
  • 42