41 What is JSON in Python?

preview_player
Показать описание
Hey guys,

welcome to Free Tutorial TV and Python tutorial for beginner.

J Son why do we use J Son. and how we can create a J Son Data.

So let's get started.

So first of all what is J Son .now named J Son stands for javascript object notation.

But despite the name which contains javascript .J Son is mostly language independent and it is specified

in the terms of object as name appears.

Now that's OK but what really is J Son.

You may ask.

Right.

So J Son is a way of structuring data and it's essentially a data format.

So J Son is a data format and same as some kind of text format.

For example XML or any other text format.

J Son is also a data text format right.

Now why does J Son is really popular and how it's useful.

Now first of all let me make it clear .that J Son can be used in most of the programming language. if

you want to use J Son in C++ java javascript python or any other language most probably the support

for J Son will be present. or any such library will be there in order to parse J Son or in order to create

J Son's right.

So J Son is really language independent.

And most of the languages you will find libraries or parses to support it.

Right.

So as we have said that J Son is a data format.

So how we can use J Son or how J Son is used.

So let me give you an example.

So for example you have a browser. and you want to get some information about the temperature in some

particular city.

Right.

So the browser has to make this request to a server . which makes this data available to the browser or

client once again.

Now there are some ways of sending this data from the client to the server.

Right.

So you can say the most simplest way is to send a string format right.

And the server is going to get this string and then its going to give you the result.

But its not so easy.

Right.

Until and unless you have some data pre-defined format its hard for the server to understand in which

format this data is coming.

And thats where the J Son comes in.

So this J Son is a data format so server knows that whatever client is sending to theserver is in the

J Son format . on the server side for example whatever language you are using in that language you can

use J Son parser in order to get this data or interpret this data.

And then according to the request you can just prepare this data in the form of J Son once again .and

send it to the client. and then whatever line same language you are using most probably you will be using

javascript . and this javascript will be able to understand that this data is in the J Son format so its

going to parse this data . and then its going to show you this data in the form of SDM using that javascript.

Right.

So this is very simple kind of J Son right.

So J Son has these curly brackets and then the values are defined like this . so there is a key and the

value for it.

So the key here is our city and the value of a city is Paris for example right.

Unit is a key and C capital C which stands for centigrade. is the value of unit.

Right.

In the same way once your server has some data its going to send it in this format.

So here low means low temperature and so low is a key.

And 16 here is the value.

Right.

High is the key and 23 is the value right.

So this is the format of very simple J Son which can be sent from the client to the Server and then server to

client.

So J Son is essentially a data format.

Now the question arises that which kind of data you can send using J Son.

Right.

So let's see what other values you can use to send data.

So in J Son you can send this data in the form of these data type which are there in this picture.

So the key which I already explained to you for example city was the key and it's always in the string

format right.

So key will be in string format and the J Son value you can see the J Son value can be an object.

It can be an array.

It can be a number.

Number means it can be integer or a decimal value and string is a string.

And other formats are TRUE FALSE For boolean .and if you don't have any data you can send null.

OK so these are the data types which can be used to send of values in J Son.

So it can be object or array or number or a string or a boolean value or if you don't have any data then you

can send null also.

OK.

**************************************************************************
please like and follow us in Facebook and Instagram.

Рекомендации по теме