其他分享
首页 > 其他分享> > 6_6 调查

6_6 调查

作者:互联网

 1 """
 2 调查
 3 """
 4 favorite_numbers = {'li jingwen': 322,
 5                     'li yunyao': 22,
 6                     'wei liangjing': 482,
 7                     'guo xuezhe': 45,
 8                     'zhao yuliang': 20,
 9                     'hu xinyi': 35
10                     }
11 favorite_languages = {
12     'jen': 'python',
13     'sarah': 'c',
14     'edward': 'ruby',
15     'phil': 'python',
16     }
17 names = list(favorite_numbers.keys())
18 names.append('jen')
19 names.append('edward')
20 for name in favorite_languages.keys():
21     if name in names:
22         print(f"Thank you {name.title()}.")
23     else:
24         print(f"{name.title()},looking forward to inviting you.")

很实用

标签:name,favorite,调查,languages,numbers,append,names
来源: https://www.cnblogs.com/scholarly/p/16558367.html