-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path7dictionary.py
More file actions
50 lines (39 loc) · 1.03 KB
/
Copy path7dictionary.py
File metadata and controls
50 lines (39 loc) · 1.03 KB
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
47
48
49
50
from ipaddress import ip_address
d1 = { }
print(type(d1))
d2 = { "rahul":"burgur","rohan":"fish","skillf":"roti","shubham":{"b":"maggie","c":"tikki","l":"paties"}}
print("1",d2)
print("2",d2["rahul"])
print("3",d2["shubham"])
print("4",d2["shubham"]["b"] )
d2["ankit"] = "junk food"
print("5",d2)
d2[420] = "kabab"
print("6",d2)
del d2[420]
print("7",d2)
d3=d2
#del d3["rahul"]
print("8",d2)#d2 m se bhi delete ho jayega content isliye copy krke delete krenge
d3=d2.copy()
del d3["rahul"]
print("9",d3)
print("10",d3.get("rahul"))
d2.update({"leena":"toffee"})
print("11",d2)
print("12",d2.keys())
print("12",d2.items())
if __name__ == '__main__':
term = int(input())
dec={}
for i in range (term):
name = input()
mark1= int(input())
mark2= int(input())
mark3= int(input())
marks = [mark1,mark2,mark3]
avg = sum(marks)/3
# dec.add({name:avg})
dec[name]=round(avg,2)
ans = input()
print(format(dec[ans],".2f"))