Untitled

mail@pastecode.io avatar
unknown
python
a year ago
184 B
3
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 []