-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictionary_python.py
More file actions
46 lines (38 loc) · 795 Bytes
/
Dictionary_python.py
File metadata and controls
46 lines (38 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
###----++dictionary+++---###
detail={
'name':'avinash',
'reg_no':21619151,
'phone':8072268801
}
print(detail)
####or####
string=f"name:%s ,reg_no:%d ,phone:%d"%(detail['name'] , detail['reg_no'], detail['phone'])
#print(string)
####0R###
deital=dict[('name','avinash'),
('reg_no',21619151),
('phone',8072268801)]
#print(detail)
detail['borther']={123,456,789}
detail['name']={'avinash':21619151,'abilash':456}
#print(detail['name']['avinash'])
#print(detail)
print(detail.get('borther'))
data={
1:'mohan',
2:'ram',
0:'jenny',
3:'avi'
}
#print(data[0])
#del(data[0])
#print(data.pop(1))
#print(data.popitem())
#data.clear()
#print(data.keys())
#print(data.values())
#print(data.items())
#for i in data:
#s=data[i]
#print(s)
#print(data[i])