SlideShare a Scribd company logo
4
Most read
5
Most read
6
Most read
Python dictionary 
.
GROUP – XII 
GROUP MEMBERS ARE: 
SAGAR KUMAR (60) 
NITESH KUMAR (57) 
SHASHIKANT KUMAR (56) 
SUNNY KUMAR (58) 
SHIVANI (59)
Contents 
• Python dictionary 
• Important points in dictionary 
• Accessing value in dictionary 
• Updating or adding in dictionary 
• Deletion in dictionary
PYTHON DICTIONARY 
Definition : A dictionary is mutable and container type can store any 
number of python objects. 
 Python dictionaries are also known 
as associative arrays or hash (#) tables. 
Dictionaries consists of pairs (items) of keys and their corresponding values. 
The general syntax of a dictionary is as follows: 
dict= {‘A’: ‘215’, ‘B’: ‘412’, ‘C’: ‘125’}
Important point of dictionary 
Each key is separated from its value by a colon (:). 
The items are separated by commas, and the whole thing is enclosed 
in curly braces { }. 
An empty dictionary without any items is written with just two curly 
braces, like this { }. 
The values of a dictionary can be of any type, but the keys must be an 
mutable data type such as strings, numbers, or tuples.
Accessing values in dictionary: 
To access dictionary elements, we use square brackets [ ] along 
with the key to obtain its value. 
for example, 
dict= {‘Name’: ‘Sagar’, ‘Age’: ‘18’, ‘Class’: ‘BCA’} 
Print
Updating or adding in dictionary: 
We can update a dictionary by adding a new entry or item (i.e., a key-value 
pair). 
Modifying an existing entry, or deleting an existing entry as shown 
below in the simple example 
dict={‘Name’: ‘Sagar’, ‘Age’: ‘18’, ‘Class’: ‘BCA’} 
dict=[‘Age’]=19; # update existing entry or item 
dict=[School]=SXC # Add new entry or item
Deletion in dictionary: 
We can either remove or delete individual dictionary elements or 
clear the entire contents of a dictionary. 
To delete or remove in dictionary; we use the del statement. 
for example, 
dict= {‘Name’: ‘Sagar’, ‘Age’: ‘18’, ‘Class’: ‘BCA’} 
del dict[Name]; # remove entry with key ‘Name’ 
dict.clear0; # remove all entries in dict 
del dict; # delete entire dictionary
THANK YOU 
.

More Related Content

What's hot (20)

PPTX
Strings in C
Kamal Acharya
 
PPTX
Python dictionary
eman lotfy
 
PPTX
Strings in C language
P M Patil
 
PDF
Python set
Mohammed Sikander
 
PPTX
Functions in Python
Shakti Singh Rathore
 
PPTX
Two dimensional arrays
Neeru Mittal
 
ODP
Python Modules
Nitin Reddy Katkam
 
PDF
Python Dictionary
Soba Arjun
 
PDF
Introduction to Python
Mohammed Sikander
 
PPTX
Chapter 17 Tuples
Praveen M Jigajinni
 
PPTX
Recursion
Abdur Rehman
 
PPTX
Nested loops
Neeru Mittal
 
PDF
Arrays in python
moazamali28
 
PDF
Python-03| Data types
Mohd Sajjad
 
PDF
Strings in python
Prabhakaran V M
 
PPT
Python List.ppt
T PRIYA
 
PPTX
Data Structures in Python
Devashish Kumar
 
PPTX
Evaluation of postfix expression
Akhil Ahuja
 
PDF
Datatypes in python
eShikshak
 
Strings in C
Kamal Acharya
 
Python dictionary
eman lotfy
 
Strings in C language
P M Patil
 
Python set
Mohammed Sikander
 
Functions in Python
Shakti Singh Rathore
 
Two dimensional arrays
Neeru Mittal
 
Python Modules
Nitin Reddy Katkam
 
Python Dictionary
Soba Arjun
 
Introduction to Python
Mohammed Sikander
 
Chapter 17 Tuples
Praveen M Jigajinni
 
Recursion
Abdur Rehman
 
Nested loops
Neeru Mittal
 
Arrays in python
moazamali28
 
Python-03| Data types
Mohd Sajjad
 
Strings in python
Prabhakaran V M
 
Python List.ppt
T PRIYA
 
Data Structures in Python
Devashish Kumar
 
Evaluation of postfix expression
Akhil Ahuja
 
Datatypes in python
eShikshak
 

Similar to Python dictionary (20)

PPTX
Dictionary.pptx
RishuVerma34
 
PPTX
DICTIONARIES (1).pptx
KalashJain27
 
PPTX
An Introduction to Tuple List Dictionary in Python
yashar Aliabasi
 
PPTX
PYTHON Data structures Fundamentals: DICTIONARIES
KanadamKarteekaPavan1
 
PPTX
Python Fundamental Data structures: Dictionaries
KanadamKarteekaPavan1
 
PPTX
Dictionary in python Dictionary in python Dictionary in pDictionary in python...
sumanthcmcse
 
PPTX
UNIT-3 python and data structure alo.pptx
harikahhy
 
PPTX
Ch 7 Dictionaries 1.pptx
KanchanaRSVVV
 
PPTX
Chapter 14 Dictionary.pptx
jchandrasekhar3
 
PDF
CHAPTER- 9 PYTHON DICTIONARIES.pdf computer science
Bavish5
 
PPTX
Data structures in Python
MITULJAMANG
 
PPTX
Chapter 16 Dictionaries
Praveen M Jigajinni
 
PPTX
.net F# mutable dictionay
DrRajeshreeKhande
 
PPTX
dataStructuresInPython.pptx
YashaswiniChandrappa1
 
PPTX
Untitled dictionary in python program .pdf.pptx
SnehasisGhosh10
 
PPTX
Python programming –part 7
Megha V
 
PDF
Python dictionaries
Krishna Nanda
 
PPTX
DICTIONARIES TUTORIALS FOR ADVANCED LEARNING OF YTHON PROGRAMMING
examcelldavrng
 
PPT
PE1 Module 4.ppt
balewayalew
 
Dictionary.pptx
RishuVerma34
 
DICTIONARIES (1).pptx
KalashJain27
 
An Introduction to Tuple List Dictionary in Python
yashar Aliabasi
 
PYTHON Data structures Fundamentals: DICTIONARIES
KanadamKarteekaPavan1
 
Python Fundamental Data structures: Dictionaries
KanadamKarteekaPavan1
 
Dictionary in python Dictionary in python Dictionary in pDictionary in python...
sumanthcmcse
 
UNIT-3 python and data structure alo.pptx
harikahhy
 
Ch 7 Dictionaries 1.pptx
KanchanaRSVVV
 
Chapter 14 Dictionary.pptx
jchandrasekhar3
 
CHAPTER- 9 PYTHON DICTIONARIES.pdf computer science
Bavish5
 
Data structures in Python
MITULJAMANG
 
Chapter 16 Dictionaries
Praveen M Jigajinni
 
.net F# mutable dictionay
DrRajeshreeKhande
 
dataStructuresInPython.pptx
YashaswiniChandrappa1
 
Untitled dictionary in python program .pdf.pptx
SnehasisGhosh10
 
Python programming –part 7
Megha V
 
Python dictionaries
Krishna Nanda
 
DICTIONARIES TUTORIALS FOR ADVANCED LEARNING OF YTHON PROGRAMMING
examcelldavrng
 
PE1 Module 4.ppt
balewayalew
 
Ad

Recently uploaded (20)

PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PDF
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
Executive Business Intelligence Dashboards
vandeslie24
 
GridView,Recycler view, API, SQLITE& NetworkRequest.pdf
Nabin Dhakal
 
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Ad

Python dictionary

  • 2. GROUP – XII GROUP MEMBERS ARE: SAGAR KUMAR (60) NITESH KUMAR (57) SHASHIKANT KUMAR (56) SUNNY KUMAR (58) SHIVANI (59)
  • 3. Contents • Python dictionary • Important points in dictionary • Accessing value in dictionary • Updating or adding in dictionary • Deletion in dictionary
  • 4. PYTHON DICTIONARY Definition : A dictionary is mutable and container type can store any number of python objects.  Python dictionaries are also known as associative arrays or hash (#) tables. Dictionaries consists of pairs (items) of keys and their corresponding values. The general syntax of a dictionary is as follows: dict= {‘A’: ‘215’, ‘B’: ‘412’, ‘C’: ‘125’}
  • 5. Important point of dictionary Each key is separated from its value by a colon (:). The items are separated by commas, and the whole thing is enclosed in curly braces { }. An empty dictionary without any items is written with just two curly braces, like this { }. The values of a dictionary can be of any type, but the keys must be an mutable data type such as strings, numbers, or tuples.
  • 6. Accessing values in dictionary: To access dictionary elements, we use square brackets [ ] along with the key to obtain its value. for example, dict= {‘Name’: ‘Sagar’, ‘Age’: ‘18’, ‘Class’: ‘BCA’} Print
  • 7. Updating or adding in dictionary: We can update a dictionary by adding a new entry or item (i.e., a key-value pair). Modifying an existing entry, or deleting an existing entry as shown below in the simple example dict={‘Name’: ‘Sagar’, ‘Age’: ‘18’, ‘Class’: ‘BCA’} dict=[‘Age’]=19; # update existing entry or item dict=[School]=SXC # Add new entry or item
  • 8. Deletion in dictionary: We can either remove or delete individual dictionary elements or clear the entire contents of a dictionary. To delete or remove in dictionary; we use the del statement. for example, dict= {‘Name’: ‘Sagar’, ‘Age’: ‘18’, ‘Class’: ‘BCA’} del dict[Name]; # remove entry with key ‘Name’ dict.clear0; # remove all entries in dict del dict; # delete entire dictionary