ast.literal_eval() ?? - Python Help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

ast.literal_eval() ?? - Python Help

Hello, I was working on something, i needed to use a dictionary from a text file and convert it into dictionary in python. I didn't know how exactly when i was doing some research i came across this function " ast.literal_eval" It worked perfectly, but i wanted understand what it does exactly ? i also needed to import the ast module in order to it to work.

8th Aug 2020, 1:10 AM
Louai Belfounes
Louai Belfounes - avatar
1 Answer
+ 1
I think its a method for text purposes same as converting datas from csv
23rd Aug 2020, 12:20 PM
KnightDeluxe12
KnightDeluxe12 - avatar