{"id":26715,"date":"2022-04-01T00:19:26","date_gmt":"2022-03-31T18:49:26","guid":{"rendered":"https:\/\/python-programs.com\/?p=26715"},"modified":"2022-04-01T00:19:26","modified_gmt":"2022-03-31T18:49:26","slug":"how-to-print-particular-json-value-in-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/how-to-print-particular-json-value-in-python\/","title":{"rendered":"How to Print Particular JSON Value in Python?"},"content":{"rendered":"

JSON is an abbreviation for JavaScript Object Notation. It means that data is stored and transferred using a script (executable) file comprised of text in a computer language. Python has a built-in library named json that handles JSON. In order to use this feature, we must first load the json package into our Python script. The text in JSON is represented by a quoted-string, which contains the value in the key-value mapping within flower braces { }.<\/p>\n

How to Read from JSON?<\/strong><\/p>\n

In Python, loading a JSON object is simple. Python includes a library named json that may be used to work with JSON data. It is accomplished by utilizing the JSON module, which gives us a plethora of methods, among which the loads() and load() methods will assist us in reading the JSON file.<\/p>\n

Here we take\u00a0demo.json<\/strong> as an Example<\/p>\n

\n
\n
{\r\n\"id\": 1,\r\n \"name\":\u00a0\"virat\",\r\n \"Address\":\u00a0[{\r\n \u00a0\u00a0\"city\"\u00a0:\u00a0\"hyderabad\",\r\n \u00a0\u00a0\"state\":\u00a0\"telangana\",\r\n \u00a0\u00a0\"geo\":\u00a0{\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"lat\":\u00a090,\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"long\":\u00a0100\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}]\r\n\u00a0}<\/pre>\n<\/div>\n<\/div>\n

Printing Particular JSON Value in Python<\/h2>\n

Approach:<\/strong><\/p>\n