6-1
tony = { 'first_name': 'Kobe', 'last_name': 'Bryant', 'age': '39', 'city': 'LA'} print(tony['first_name'], tony['last_name'], tony['age'], tony['city'])
6-2
num = { 'Jackson': 1, 'Tony': 2, 'Tom': 3, 'John': 4} print( "Jackson: ", num["Jackson"]) print( "Tony: ", num["Tony"]) print( "Tom: ", num["Tom"]) print( "John: ", num["John"])
6-5
river = { 'Nile River': 'Egypt', 'Amazon River': 'Brazil, Peru, Colombia', 'the Yangtze River': 'China'} for key, value in river.items(): print(key ,"runs through",value)
6-8
pets = [] Lily = { 'type': 'Big Dog', 'owner': 'Jack'} Kelly = { 'type': 'Small Dog', 'owner': 'Jackson'} pets.append(Lily) pets.append(Kelly) for pet in pets: for key,value in pet.items(): print(key, ":", value) print("")