What is JSON?
JSON (JavaScript Object Notation) — it is a lightweight text-based, language-independent data exchange format that is easy to read and write for humans and machines. JSON can represent two structured types: objects and arrays. Object — it is an unordered collection of zero or more name / value pairs. The array — it is an ordered sequence of zero or more values. Values can be strings, numbers, booleans, zero, and these two structured types.
The challenge is to sort the JSON first by code , then by class followed by enrollment_no .
Code # 1: sort in order
< code class = "comments">}, < code class = "undefined spaces"> |
Output:
DBMS C 9915103000 JIIT COA A 8815103057 JSS CN A + 8815103057 JSS
Code # 2: using an external library like like Pandas (sort in ascending order).
|
Exit :
code grade enrollment_no name 0 CN A + 8815103057 JSS 1 COA A 8815103057 JSS 2 DBMS C 9915103000 JIIT