- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdictionaries.py
More file actions
Latest commit
23 lines (20 loc) · 574 Bytes
/
Copy pathdictionaries.py
File metadata and controls
23 lines (20 loc) · 574 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# this program depicts the use of dictionaries in python
importjson#json library is imported for the use of the json.dumps feature for better printing of the dictionary
mydict= {
'car1' : {
"Brand" : "Audi",
"Model" : "Q4",
"year" : 2016
},
'car2' : {
"Brand" : "Mercedes Benz",
"Model" : "S-class",
"year" : 2014
},
'car3' : {
"Brand" : "Rolls Royce",
"Model" : "Ghost",
"year" : 2020
}
}
print(json.dumps(mydict),indent=2)