元旦来临必须写的代码【永利集团304com】

# -------------------------------# 节日祝福 Author:传习者戚# Email: qijiuzhu@tsinghua.org.cn# 2017-12-31# Python3.5# -------------------------------# 定义祝福语bast_wishes = lambda name: "祝" + name +  "同学2018元旦快乐!新的一年心想事成!"# 朋友信息资料friends = dict( 研三={"联系": "Yes", "人品": "A"}, 演艺={"联系": "Yes", "人品": "B"}, 清华={"联系": "Yes", "人品": "A"}, 酒肉={"联系": "Yes", "人品": "C"})# 筛选拟发祝福的朋友best_friends = [key for key, value in friends.items() if value["联系"] == "Yes" and value["人品"] == "A"]# 分配并输出祝福语information = list(map(bast_wishes, best_friends))print("n".join(info for info in information))

发表评论

电子邮件地址不会被公开。 必填项已用*标注