List and Dictionary
List and Dictionary
Dictionaries
LEARNING OUTCOMES
LEARNING OUTCOMES
After studying this lesson, students
will be able to:
>>> A={1:"one",2:"two",3:"three"}
1 one
A= 2 two
3 three
KEYS VALUES
CREATING A DICTIONARY – dict()
CREATING DICTIONARAY – dict()
OUT PUT
CREATING AND TRAVERSING DICTIONARAY
OUT PUT
DICTIONARAY – BUILT IN METHODS
DICTIONARAY – BUILT IN METHODS
clear method
copy method
get method
items method
keys method
update method
dict.values() METHOD
Sample Dictionary
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81,
10: 100, 11: 121, 12: 144, 13: 169, 14: 196, 15: 225}