Stack Overflow Asked by Thribhuwan on December 11, 2021
I have find particular JSON block find by Value from main JSON below is the json
mainJSON = [{ "name":"John", "car":"Scorpio" },{ "name":"John", "car":"Maruti800" },{ "name":"Priya", "car":"BMW" },{ "name":"Nick", "car":"Audi" }, { "name":"Nick", "car":"Bentley" }]
search all json block find by name "Jonh"
like below OUTPUT
{ "name":"John", "car":"Scorpio" }
{ "name":"John", "car":"Maruti800" }
import json
data = json.load(mainJSON)
Please help me here to find block in quickly
[x for x in mainJSON if x.get('name') == 'John']
Answered by CPak on December 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP