music = { 
	"Band 1": {
		"Album A": ["1-Track A1", "1-Track A2", "1-Track A3"],
		"Album B": ["1-Track B1", "1-Track B2", "1-Track B3"],
		"Album C": ["1-Track C1", "1-Track C2", "1-Track C3"]
	},
	"Band 2": {
		"Album A": ["2-Track A1", "2-Track A2", "2-Track A3"],
		"Album B": ["2-Track B1", "2-Track B2", "2-Track B3"],
		"Album C": ["2-Track C1", "2-Track C2", "2-Track C3"]
	},
	"Band 3": {
		"Album A": ["3-Track A1", "3-Track A2", "3-Track A3"],
		"Album B": ["3-Track B1", "3-Track B2", "3-Track B3"],
		"Album C": ["3-Track C1", "3-Track C2", "3-Track C3"]
	}
}

import random
def pick_track(music_collection):
	# we must pick a key and look that up if we get a dictionary
	if isinstance(music_collection, dict):
		chosen = music_collection[random.choice(list(music_collection.keys()))]
	else:
		chosen = random.choice(music_collection)
	
	if isinstance(chosen, str):  # it's a string, so it represents a track
		return chosen
	else:  # it's a collection (list or dict) so we have to pick something from inside it
		return pick_track(chosen)
		
		
def pick_track2(music_collection):
	if isinstance(music_collection, dict):
		random_key = random.choice(list(music_collection.keys()))
	else:
		random_key = random.randrange(len(music_collection))
	chosen = music_collection[random_key]
	if isinstance(chosen, str): 
		return [random_key, chosen]
	else:
		return [random_key] + pick_track2(chosen)
        
for i in range(5):
	print(pick_track(music))
	
for i in range(5):
	print("Band: '{}' - Album: '{}' - Track {}: '{}'".format(*pick_track2(music)))
