Python JSON

0

Python JSON

  • Python JSON stand for JavaScript object Notation.
  • JSON is a syntax for storing and exchanging data.
  • JSON is text, written with JavaScript object notation.
  • JSON has a built-in package called JSON, which can be used to work with JSON data.

Parse JSON - Convert from JSON to Python

  • If you have a JSON string, you can parse it by using the json.loads() method.
  • Example:

Covert from Python to JSON

  • If you have a Python object, you can convert it into JSON string by using the json.dumps() method.

JSON String:

You can convert Python objects of the following types, into JSON string:
  • list
  • tuple
  • string
  • int
  • float
  • True
  • False
  • None
  • dict

  • Python                                                  JSON
  • dict                                                       Object
  • list                                                         Array
  • tuple                                                      Array
  • str                                                          String
  • int                                                         Number
  • float                                                      Number
  • True                                                      true
  • False                                                     false
  • None                                                     null


Output:




















Tags

Post a Comment

0Comments
Post a Comment (0)