6.7
friend_0 = {'first_name':'hao','last_name':'zeng yao','age':22,'city':'He zhe'}
friend_1 = {'first_name':'zhang','last_name':'yu','age':22,'city':'Ji nan'}
friend_2 = {'first_name':'yuan','last_name':'hao','age':21,'city':'Ji nan'}
friends = [friend_0,friend_1,friend_2]
for friend in friends:
print(friend)
6.8
pet_0 = {'type': 'dog','The host name': 'Tom'}
pet_1 = {'type': 'cat','The host name': 'john'}
pet_2 = {'type': 'pig','The host name': 'A'}
pets = [pet_0, pet_1, pet_2]
for pet in pets:
print(pet)
6.9
favorite_places = {
'alice': ['Hang zhou','Bei jing','Qing dao'],
'david': ['Macau'],
'carolina': ['Tai wan','Hong kong'],
}
for name,places in favorite_places.items():
print(f"\n{name.title()}'s favorite places are:")
for place in places:
print(f"\t{place.title()}")
6.10
favorite_numbers = {
python编程从入门到实践(第二版)第六章习题答案6.7-6.11
最新推荐文章于 2026-04-17 02:06:29 发布

第六章习题答案6.7-6.11&spm=1001.2101.3001.5002&articleId=127416171&d=1&t=3&u=0a11b16058e84bcbba5defc9c9a54aec)
1万+

被折叠的 条评论
为什么被折叠?



