Untitled
unknown
python
2 years ago
184 B
6
Indexable
import ast def convert_text_to_list(text): try: return ast.literal_eval(text) except ValueError: print("Error in converting the given text.") return []
Editor is loading...
import ast def convert_text_to_list(text): try: return ast.literal_eval(text) except ValueError: print("Error in converting the given text.") return []