<jupyter_start><jupyter_text>- Dictionary is closed by curly bracket {}- There should be two types data in format "keys:value"<jupyter_code>A={1:'Ram',22:'Shyam',3:'Hari',4:'Chatur',5:'Joh',6:'Sita'}
print(A)
A[1],A[22]  #A[keys] = value, keys are not index
A.get(1),A.get(2) #another way to get value
D = {'ram':60,'shyam':70,'shiva':39,'radha':54}
print(D)
D.keys()
D.keys()
data={11:'nepali',22:'English',30:'Science',49:'Social Studies'}
print(data)
data[11],data[22],data[30]
data.get(11), data.get(3)<jupyter_output><empty_output><jupyter_text>- How can we convert two lists into dictionary<jupyter_code>L=['ram', 'shyam','hari','sita','gita']
M=[20,45,67,54,34,12,23,45,56]

D=dict(zip(M,L)) #dict(zip(first list,second list))

print(D)<jupyter_output>{20: 'ram', 45: 'shyam', 67: 'hari', 54: 'sita', 34: 'gita'}<jupyter_text>could we convert three lists into single dictionary??<jupyter_code>R=[1,2,3,4,5,6,7,8,9]
K=[10,20,30,40,50,60,70,80,90]
D=dict(zip(R,K,G)) 
print(D) #errer represrnts that we could't convert directly more than 2 list into dictionary<jupyter_output><empty_output><jupyter_text>- we use following method to convert three or more lists into dictionary- in dictionary we use "update" instead of "append in list".<jupyter_code>#first create three lists
N = ['ram','shyam','hari','gopal','john'] 
A=['kaski','tanahun','dhading','kathmandu','nuwakot']
G = ['A+','B-','C+','B','D-']
Data = {} #empty dictionary

Data.update({'Name':N,'Address':A,'Grade':G}) # adding three list indo dictionary with keys and values, list are values, we have to add keys
print(Data)

data=dict(zip(N,A)) #convert two list N and A into dictionary
print(data)<jupyter_output>{'ram': 100, 'shyam': 101, 'hari': 10, 'gopal': 2, 'john': 4}<jupyter_text>- Find the type of data set<jupyter_code>D = {1,2,3,4,5,6,7,8,9} 
A = (100,101,10,2,4,5)
T = [1,2,3,4,5,6,7,8,9]
L = {1:'2',2:'3',3:'4',4:'5'}
print(type(L)),print(type(D)),print(type(T)),print(type(D))
#addition of list
L=[1,2,3,4,5]
M=[3,4,5,6,7,8]
M+L
print(M+L)
#order matters
L+M
print(L+M)
D={} #empty dictionary
for i in range(10):
    for j in range(10):
        if i == j:
            D.update({(i,j):10*i+j})
        elif i!=j:
            D.update({(i,j):100*i+j})
print(D)
for item,i,k in zip(['apple','ball','book','girl','boy','key','banana','kite','cellphone','pen'],\
                    range(10),[12,45,33,23,35,67,98,45,67,34]):
    print(item,"|",i,"|",k)<jupyter_output>apple | 0 | 12
ball | 1 | 45
book | 2 | 33
girl | 3 | 23
boy | 4 | 35
key | 5 | 67
banana | 6 | 98
kite | 7 | 45
cellphone | 8 | 67
pen | 9 | 34
{'fraction_non_alphanumeric': 0.2254826254826255, 'fraction_numerical': 0.08185328185328185, 'mean_word_length': 6.079234972677596, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '33004', 'license': 'MIT', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1099, 'n_words': 238, 'path': 'Class/Dictionary .ipynb', 'repo_name': 'Sabin63/Python-Jupyter_Notebook', 'size': '2590'}