+ 3
Dictionary->List/Sets conversion
What is the best way to convert dictionaries to list and parse them based on values
4 Respuestas
+ 8
You can use standard functions
dict.items()
dict.keys()
dict.values()
+ 4
I don't know if this is the best way, but it may help
dic = {1: 'a',
2: 'b',
3: 'c',
4: 'd'
}
lst = []
for i in dic:
lst.append(dic[i])
print(lst)
+ 3
https://www.sololearn.com/Discuss/2332053/?ref=app
I wanted to know of wr can solve this probpem in multiple ways