笔记整理自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