Загрузка...

17 Explanation of Dictionary Operation in Python Programming.

First of all you use these curly brackets and inside these curly brackets you provide a list of key

value pairs.

So let's provide a list of key value pairs so first key is name and the name is Max.

The second key is for example Age and The Age of Max is let's say 14 and we can also write here in which

year he was born. lets write year.

And he was born in 2000 for for example.

and I'm going to press enter to save .

and once again I'm going

to just access the values inside this dictionary.

which is D . you can see our dictionary is created now.

as I said dictionary is a list of key value pairs . all these values which you see here before

this colon are called the key.

So name is a key here.

year is a key here and age is a key here.

And whatever values you see after the colon are called values so Max is a value.

2004 is a value and 14 is a value and you can access the values from a dictionary based upon their

keys.

So for example I have this dictionary D . I can use the square bracket and the key name for example I want

to get the name value.

I can just give the name key here . and then press enter . and it's going to be doing me the associated

value related to key name in the same way.

You can use other keys also for example age. and I'm going to press enter . and it's going to give me 14

which is a value.

So it is a key here . 14 is the value of what type of data types you can store in a dictionary.

So as key you can define any data type.
**************************************************************************
please like and follow us in Facebook and Instagram.
facebook: https://www.facebook.com/TechnologyTv

Instagram: https://www.instagram.com/heikhamsingh

Twitter: https://twitter.com/hanandkumarsing

Видео 17 Explanation of Dictionary Operation in Python Programming. канала Free Tutorial TV
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять