Answers for "how to extract dictionary values in python"

2

how to get all the values from the dict in python

a = {1:2 , 2:3 , 3:4}
values = a.values()
Posted by: Guest on July-21-2020
0

how to extract dictionary value from string in python

import ast
temp = "'mycode':['1','2','firstname','Lastname']"
key,value = map(ast.literal_eval, temp.split(':'))
status = {key: value}
Posted by: Guest on September-13-2021

Code answers related to "how to extract dictionary values in python"

Python Answers by Framework

Browse Popular Code Answers by Language