Back

Sanskar

Keen Learner and Exp... • 25d

Day 19 of learning python as a beginner. Topic: JSON file (exploring surface). JSON stands for JavaScript Object Notation however it is not limited to JavaScript only. JSON is used to store and share structured data which is both readable by human and understandable by machines. It's syntax includes a list within which all the dictionary lies (JSON's data is a key value pair). For creating JSON in python you have to import json. I created a simple data base of students which can be viewed, added and deleted. I also used different types of values so that I can remember that JSON is not limited to strings only. For writing a JSON you use the function json.dump (this writes json directly to a file) while json.dumps only convert python data into json strings and does not write to file (the difference in both dump is of 's' if you are wondering). I also found out that it is not always necessary to put a def __init__ in a class when sometimes you just don't need to initialise attributes. I would appreciate your suggestions of future learning topics and challenges, I would also appreciate your thoughs regarding my code and if I have done something wrong here which didn't caught my attention.

Reply
2

More like this

Recommendations from Medial

Image Description

Sanskar

Keen Learner and Exp... • 1m

Day 10 of learning python as a beginner. Topic: File I/O You guys remeber I once created a to-do list (most probably on day 7)? many amazing people suggested that I should also put a history of tasks. At that time I was not aware about the File I/O

See More
2 Replies
3
Image Description
Image Description

Yash

YoYo • 9m

I know the basics of python language like functions, file handling, stack, etc what should I learn in python to get the fastest internship or job as freshers

4 Replies
2

Sanskar

Keen Learner and Exp... • 19d

Day 25 of learning python as a beginner. Topic: database handling. I used to write simple programs which just showed some text in the console when I started learning python. I didn't used to store that data somewhere because I didn't know how to.

See More
Reply

Prince Yadav

Co -founder at Trade... • 1y

Prefix data structure, often referred to as a trie, is a tree-like data structure used for storing and retrieving a dynamic set of strings efficiently, particularly when dealing with prefix-based operations. #Datastructure #codingjourney Prefix Expr

See More
Reply
6
Image Description
Image Description

Account Deleted

Hey I am on Medial • 2m

hey guys , need bit of a help I tried removing that 'edit with lovable' from .apk file with manus (I know there are better ways to do , but I'm lazy) it gave a json file in return so gave manus that .json file and asked to create into .apk (ik

See More
18 Replies
3
14

Suraj Dusane

Hey I am on Medial • 1y

How I Complete My 5-Day Boring Task in Less Than Half an Hour👇🏻 1. Eureka Moment: So, I was stuck making PowerPoint slides manually, which was a real pain. Then, I had this genius idea to make things easier by automating the whole process. 2. Hun

See More
Reply
9
Image Description
Image Description

Rajat Garg

Software Engineer • 1y

Which is better Blob or File?

3 Replies
5

Namit

Not going down today • 1m

Couldn't sleep, so I built a JSON formatter. Was tired of slow, ad-filled ones full of distractions. ✅ Minimal UI ✅ Auto-fixes bad JSON ✅ Adjustable height to read big blocks ✅ No ads. Just works. Try it → https://www.namitjain.com/tools/json-forma

See More
Reply
1
Image Description

Sam

New member • 2m

which online website is good to study python and AI courses

1 Reply
3

Download the medial app to read full posts, comements and news.