Learning Python: The Ultimate Guide for Beginners to Coding with Python with Useful Tools



Download 2,02 Mb.
Pdf ko'rish
bet63/126
Sana01.01.2022
Hajmi2,02 Mb.
#285662
1   ...   59   60   61   62   63   64   65   66   ...   126
Bog'liq
Learning Python The Ultimate Guide for Beginners to Coding with

Chapter 3: Dictionary
Dictionary offers programmers a whole lot of options, especially in storing
limitless volume of information. In this chapter, you will understand what
dictionaries  are,  how  you  can  use  them  in  a  loop,  build  lists  inside  them,
and create a dictionary insider another dictionary. If you can understand the
concept of dictionaries in Python, it will equip you in various ways and give
you  the  opportunity  to  model  different  live  situation  situations.  You  can
create  a  simple  dictionary,  which  represents  an  individual.  With  this,  you
can  store  various  information,  including  the  person’s  name,  location,  age,
phone details, security number, anything you can think of as it concerns the
person. You can do so much a dictionary in Python, such as storing people’s
names with their best food, words with their meaning, countries and their
presidents, etc.
Let us look at a game with teams having different scores and colors. This
code stores information as it relates to a particular team.
team1 ={‘color’: ‘red’, ‘scores’ : 3}
print(team1 [‘color’])
print(team1 [‘scores’])
The dictionary team1 stores the color and scores whereas the last two lines
access the dictionary before displaying the information as seen below
red
3
New programming concepts require consistent practicing to perfect it. Since
you are learning a new language, it is important to painstakingly understand
this  concept.  If  you  understand  it,  you  can  apply  it  in  all  real-world
situations.

Download 2,02 Mb.

Do'stlaringiz bilan baham:
1   ...   59   60   61   62   63   64   65   66   ...   126




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish