Output:

Python

1

2

3

4

5

6

7

8

9

phone number:1234568790

phone number:9865321478

phone number:9325698789

phone number:6326598752

phone number:9862365981

The above example is creating the dictionary of 5 elements.In each element first string is a key and second string is value i.e ramu is the key for the value of 1234567890,so rest of all also created in same manner

We can create the dictionary by using predefined method “dict()”,by using this method we can create the dictionary.But here we can’t use use like key and pairs,we can pass the keyword arguments

Example:

Output:

Python

1

2

tuples are:[('skill','Python'),('contact',9542132140L),

('earns',5462.325),('name','samad'),('Address','Bangalore')]

Get Method:

Get method also one of the method to get the specific value by using key ,while get we found specific in dictionary then it will return the value or else it will return the None,But when we are using key we can mentione the default statement also