SyntaxFix
Write A Post
Hire A Developer
Questions
Try this
keys = [next(iter(x.keys())) for x in test] print(list(keys))
The result looks like this. ['foo', 'hello']
You can find more possible solutions here.