-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment 7.py
More file actions
30 lines (29 loc) · 779 Bytes
/
Assignment 7.py
File metadata and controls
30 lines (29 loc) · 779 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
song = {
'title': 'The Ballroom Blitz',
'artist': {
'name': 'The Sweet',
'members': ['Andy Scott', 'Steve Mann', 'Bruce Bisland', 'Paul Manzi', 'Lee Small']
},
'album': 'Desolation Boulevard',
'genre': 'Glam Rock',
'year': 1974,
'track': 1,
'discNumber': 1,
'compilation': False,
'fileInfo': {
'duration': '4:07',
'fileSize': '9.3 MB',
'bitRate': '256 kbps',
'sampleRate': '44.100 kHz',
'channels': 'Stereo'
},
'copyright': '1988 Capitol Records, LLC'
}
for key in song:
if isinstance(song[key], dict):
value = song[key]
print(key, ':')
for key in value:
print(' ', key, ':', value[key])
else:
print(key, ':', song[key])