1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 浙江省高校计算机等级考试二级Python 程序设计题12——统计缺课学生名单|备考

浙江省高校计算机等级考试二级Python 程序设计题12——统计缺课学生名单|备考

时间:2023-08-05 23:02:45

相关推荐

浙江省高校计算机等级考试二级Python 程序设计题12——统计缺课学生名单|备考

笔记整理自B站UPWLB工作生活两不误的个人空间-WLB工作生活两不误个人主页-哔哩哔哩视频教程​​​​​​Python 程序设计题12_哔哩哔哩_bilibili

程序设计题12

Python代码

代码一

all_student = input().split()present_student = input().split()all_student = [name.lower() for name in all_student]present_student = [name.lower() for name in present_student]res = []# 第一种for name in all_student:if name not in present_student:res.append(name)print(' '.join(res))

代码二

all_student = input().split()present_student = input().split()# 第二种all_student = [name.lower() for name in all_student]present_student = [name.lower() for name in present_student]res = list(set(all_student) - set(present_student))print(' '.join(res))

输入样例

张三 李四 王五 赵六 Lily Jack王五 赵六 jack 张三

输出样例

李四 lily

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。