Python dictionary in Hindi

What is Python Dictionary

python में dictionary एक unordered collection होता है जो { } के अंदर key pair values को store करता है, key pair values को comma से separated किया जाता है ,और हर value को comma separate करते हैं.

How to Access Dictionary items

dictionary में values को access करने के लिए उसकी key का use किया जाता है

How to Change Dictionary items

dictionary में existing value को change करने के लिए key का use करते हैं

How to Add items in Dictionary

dictionary में हम new key pair values को आसानी से add कर सकते हैं

Iterate Dictionary items

Dictionary के items को iterate करने के लिए loop का use किया जाता है हम loop का use करके key को iterate कर सकते हैं, value को iterate कर सकते हैं, उन items को भी iterate कर सकते है

What is Nested Dictionary

जब हम dictionary के अंदर भी dictionary बनाते हैं तो इस nested dictionary बोलते हैं.

Dictionary Methods

python मे dictionary के लिए build-in methods होते है, जिनका use करके dictionary के साथ अलग अलग operation perform किया जाता है। 

Syntex:

method को किसी भी variable के साथ use करने के लिए dot ( . ) का use करते है।

Example:

fromkey() : इस method का use हम new dictionary को create करने के लिए करते है जिसमे हम new keys लेते है और उसमे same value को assign करते है। 

How to Remove Dictionary items

pop(): Specified key के pair को remove करता है और value return करता है। 

popitem(): Last inserted key-value pair को remove करता है।

del: Specified key के pair को delete करता है।

clear(): सारे items को remove करता है। 

How to Copy Dictionaries

copy(): Shallow copy बनाता है।

dict(): Shallow copy बनाता है।

Dictionary के कुछ और useful methods :

 

get(): Specified key की value return करता है।

items(): Dictionary के items (key-value pairs) return करता है।

keys(): Dictionary के keys return करता है।

setdefault(): Specified key की value return करता है, अगर key exist नहीं करती, तो उस key और default value को add करता है।

update(): Specified key-value pairs से dictionary को update करता है।

values(): Dictionary के values return करता है।

उम्मीद करते है कि आपको Python Dictionary अच्छे समझ मे आ गया होगा । अपने learning को continue रखने के लिए next button पर click करे,

Add a comment...

  • All Posts
  • Artificial Intelligence
  • Computer Fundamentals
  • Computer Networks
  • Data Analytics
  • Data Science
  • DBMS
  • Deep Learning
  • Digital Electronics
  • DSA with Python
  • Excel
  • Exercise
  • Git & Github
  • Machine Learning
  • Matplotlib
  • Natural Language Processing
  • NumPy
  • Operating System
  • Pandas-s
  • Power BI
  • Python Tutorial
  • Scikit-learn
  • Seaborn
  • SQL & MySQL
computer networks

Table of Contents All Chapters 1. OSI Model      1.1. Physical Layer      1.2. Data Link Layer  ...

computer networks

Table of Contents All Chapters 1. Topology 2. Types of Topology      2.1. Point to Point Topology    ...

computer networks

Table of Contents All Chapters 1. Data Communication 2. Types of Data Communication      2.1. Simplex      2.2....

digital electronics number system

Table of Contents All Chapters 1. Logic Gate 2. AND Gate      2.1. AND Gate Truth Table 3. OR...

Edit Template

Sign up to track your learning

Login to continue your learning tracking

To reset your password, please enter your email address or username below.

Scroll to Top