I want to sort this dictionary through its keys.I am adding two lists into one dictionary...
list1=[]
list2=[]
dict1={}
dict2={}
n=input("Enter the number of contacts : ")
for i in range(0,n):
name1=raw_input("Enter your name: ")
num=input("Enter your phone number: ")
list1.extend([name1])
list2.extend([num])
dict1=dict(zip(list1,list2))#to convert two list into dictionary
keys=dict1.keys()
keys.sort()
for i in keys:
dict2[i]=dict1[i]
print dict2