Table of Contents
Python Tutorial
Table of Contents
Python Tutorial
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 करे,
- 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

Table of Contents All Chapters 1. Personal Area Network 2. Local Area Network 3. Campus Area Network 4. Metropolitan Area...

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

Table of Contents All Chapters 1. Special Logic Gate 2. XOR Gate 2.1. XOR Gate Truth Table 3....

Table of Contents All Chapters 1. Universal Logic Gates 2. NOR Gate 2.1. NOR Gate Truth Table 3....

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

Table of Contents All Chapters 1. Simplification 2. Simplification using Boolean Algebra Theorems 3. Simplification using K-map Digital Electronics...

Table of Contents All Chapters 1. Identity Laws 2. Null Laws 3. Domination Laws 4. Idempotent Laws 5. Complement Laws...