Untitled

mail@pastecode.io avatarunknown
python
2 months ago
184 B
1
Indexable
Never
import ast

def convert_text_to_list(text):
    try:
        return ast.literal_eval(text)
    except ValueError:
        print("Error in converting the given text.")
        return []