DEV Community

Durga Pokharel
Durga Pokharel

Posted on • Updated on

Day 19 of 100DaysofCode: Simple Code on JSON

This is my 19th day of #100Dayscode and #python. Today I continue to learn python access to web data. In that course I learned XML.XML stand for Extensible markup language. The primary purpose of XML is to help information system share structure data. It started as a specified subset of the standard generalized markup language and is design to be the relatively human language.

While taking the course I learned that XML is little bit complex than JSON. JSON is more popular than XML. XML is not really bad it is very powerful. It is more powerful than in general we need. JSON stand for JavaScript Object Notation.

Simple JSON Program

My code start with importing json. JSON represent data as a nested list and dictionary. And here is an object inside of data. In dictionary we have key value pair but in JSON these are called object.

import xml.etree.ElementTree as ET
import json
data = """<person>
<phone type = "int1">
+1 732 303 4456
<email hide = "yes"/>
tree = ET.fromstring(data)
Enter fullscreen mode Exit fullscreen mode

Day 19 of #100DaysOfCode and #pythoncode
* Continue to learn python access to web data
* Learned more about XML
* Simple program on JSON

— Durga Pokharel (@mathdurga) January 12, 2021

Discussion (0)