首先使用list1
list2两个列表由若干个学号组成list1是选课名单编写程序,找出谁没来上课,按学号由小到大顺序输出,每个一行
这就是数组求差集,遍历后每个用not in 判断
print(sorted(set(list1)-set(list2)))