Json Getting a corresponded value from input value id

You can iterate through the list and compare each id with the input id.

    for x in json_file:
        if x['id'] == int(input_id):
            title = x['title']
            href = x['href']

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top