Skip to content

Commit 7375e91

Browse files
committed
removed html tags, removed weird color at line 70 and 117
1 parent 72909dc commit 7375e91

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

contrib/advanced-python/json-module.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What is JSON?
44

5-
- <a href="https://www.json.org/json-en.html">JSON (JavaScript Object Notation)</a> is a format for structuring data.
5+
- [JSON]("https://www.json.org/json-en.html") (JavaScript Object Notation) is a format for structuring data.
66
- JSON is a lightweight, text-based data interchange format that is completely language-independent.
77
- Similar to XML, JSON is a format for structuring data commonly used by web applications to communicate with each other.
88

@@ -14,7 +14,7 @@
1414
age = 21
1515
```
1616

17-
- When we use `age`, it gets replaced with `21`. However, <i>age doesn't contain 21, it contains the address of the memory location where 21 is stored</i>.
17+
- When we use `age`, it gets replaced with `21`. However, *age doesn't contain 21, it contains the address of the memory location where 21 is stored*.
1818

1919
- While this works locally, transferring this data, such as through an API, poses a challenge. Sending your computer’s entire memory with the addresses is impractical and insecure. This is where JSON comes to the rescue.
2020

@@ -67,7 +67,7 @@ print(students_dict['name'])
6767
- Ouput:
6868

6969
```json
70-
{'id': '01', 'name': 'Yatharth', 'department': 'Computer Science Engineering'}
70+
{"id": "01", "name": "Yatharth", "department": "Computer Science Engineering"}
7171
Yatharth
7272
```
7373

@@ -114,16 +114,15 @@ f.close()
114114
- Ouput
115115

116116
```json
117-
{'id': '01', 'name': 'Yatharth', 'department': 'Computer Science Engineering'}
118-
{'id': '02', 'name': 'Raj', 'department': 'Mechanical Engineering'}
117+
{"id": "01", "name": "Yatharth", "department": "Computer Science Engineering"}
118+
{"id": "02", "name": "Raj", "department": "Mechanical Engineering"}
119119
```
120120
- `json.load()`: Reads JSON data from a file object and deserializes it into a Python object.
121121
- `json.loads()`: Deserializes JSON data from a string into a Python object.
122-
<hr>
123122

124-
### Addtiotnal Context
123+
124+
## Addtiotnal Context
125125
Relation between python data types and json data types is given in table below.
126-
</br>
127126

128127
| Python Object | JSON Object |
129128
|-----------------|-------------|
@@ -288,7 +287,4 @@ write_json(y)
288287
}
289288
```
290289

291-
</br>
292-
<hr>
293-
294290
The Python json module simplifies the handling of JSON data, offering a bridge between Python data structures and JSON representations, vital for data exchange and storage in modern applications.

0 commit comments

Comments
 (0)