Python list->dict conversion question

Asked 2 years ago, Updated 2 years ago, 16 views

a=[{'a': '1', 'b': '2', 'c': '3'}]

This is the form of the list I received

Can I change it to dict by erasing the brackets on both ends?

python

2022-09-21 21:18

1 Answers

You can do it as below.

d = a[0]


2022-09-21 21:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.