0% found this document useful (0 votes)
1 views13 pages

Dictionaries

dictionaries in python

Uploaded by

ANU JAYAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views13 pages

Dictionaries

dictionaries in python

Uploaded by

ANU JAYAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

DICTIONARIES

DICTIONARIES
 associates a set of keys with data values
 a dictionary is a mapping between a set of keys
and a set of values
 Each key
 maps to a value.
 The association of a key and a value is called a
key-value pair, sometimes called an item or an
entry
 written as a sequence of key/value pairs
separated by commas and the entire
sequence is enclosed in a pair of braces
 key is separated from its value by a colon (:)
Traversing a dictionary using for
loop
Inserting keys and updating key
values
REMOVING KEYS
s.get()
dict.pop(key)
dict.pop(key,default)
dict.keys(),dict.values,dict.items(),dict.clear()
Dictionary aliasing and copying

You might also like