-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDict_iterate.py
44 lines (32 loc) · 998 Bytes
/
Dict_iterate.py
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
programming = {
"c" : "Richie",
"c++" :"stroustrup",
"Java" : "gosling",
"Python" : "Rossum",
"c" : "thomson"
}
print(programming)
Batches = {
"PPA" : 18000,
"LB" : 16700,
"Python" : 16500,
"Angular" : 15000
}
print("\n____________________________________________________________\n")
print("Data of Dictionary is : ",Batches)
print("Data traversal using for loop")
for x in Batches:
print("keys is : ",x)
print("\n____________________________________________________________\n")
for x in Batches:
print("key is : ",x," ::: values is : ",Batches[x])
print("\n____________________________________________________________\n")
for x in Batches:
print(x," : ",Batches.get(x))
print("\n____________________________________________________________\n")
keyBatches = Batches.keys()
print(keyBatches)
print(type(keyBatches))
valueBatches = Batches.values()
print(valueBatches)
print(type(valueBatches))