How to print particular JSON value in Python

Hi, everyone in this post we will learn How to print particular JSON values in Python.

what is the JSON file?

JSON stands for JavaScript Object Notation and it is used to store data in an organized manner.

To import JSON files in Python we use:-

data=json.load(“Name of the file”)

So after importing the data, the question arises that how we can access the data inside the JSON file.

So we only have to use the slicing method which we often use in strings or lists.

Now take a look at the code to access a particular data in the JSON file.

import json

print("Here is the data whic we have imported\n",data)
#  Use the slicing to get a particular value from a json file.
print("First Print")
print("Second Print")

Here is the output:-

Print particular JSON value in Python

Thank You

Also read: Python program to extract a single value from JSON response (Using API call)

Python JSON Encoder and Decoder

Leave a Reply

Your email address will not be published.