-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path024.nested_data.py
58 lines (52 loc) · 1.21 KB
/
024.nested_data.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
albums = [
("Welcome to my Nightmare", "Alice Cooper", 1975,
[
(1, "Welcome to my Nightmare"),
(2, "Devil's Food"),
(3, "The Black Widow"),
(4, "Some Folks"),
(5, "Only Women Bleed"),
]
),
("Bad Company", "Bad Company", 1974,
[
(1, "Can't Get Enough"),
(2, "Rock Steady"),
(3, "Ready for Love"),
(4, "Don't Let Me Down"),
(5, "Bad Company"),
(6, "The Way I Choose"),
(7, "Movin' On"),
(8, "Seagull"),
]
),
("Nightflight", "Budgie", 1981,
[
(1, "I Turned to Stone"),
(2, "Keeping a Rendezvous"),
(3, "Reaper of the Glory"),
(4, "She Used Me Up"),
]
),
("More Mayhem", "Imelda May", 2011,
[
(1, "Pulling the Rug"),
(2, "Psycho"),
(3, "Mayhem"),
(4, "Kentish Town Waltz"),
]
),
]
for name,artist,year,songs in albums:
print("Ablums: {}, Artist: {}, Year: {}, Songs: {}".format(name,artist,year,songs))
print()
album = albums[3]
print(album)
songs = album[3]
print(songs)
song = songs[2]
print(song)
print(song[1])
print()
mayhem = albums[3][3][2][1]
print(mayhem)