以下三个集合 用Python怎么写

img



Python = {'王海','李梦涵','张黎明','李鹏','宋佳'}
VB={'张黎明','杨悦','赵天一','王新年','刘亚军','王海'}
C={'李鹏','张颖','王海','杨悦'}

onlyPython = Python.difference(C).difference(VB) # 差集
allLesson=Python.intersection(C).intersection(VB) # 交集
oneLesson=C.difference(Python).difference(VB).union(VB.difference(Python).difference(C)).union(onlyPython) # 差集的并集


Python={'王海','李梦晗','张黎明','李鹏','宋佳'}
VB={'张黎明','杨月','赵天意','王新年','刘亚军','王海'}
C={'李鹏','张颖','王海','杨月'}
print('只会Python不会其它语言的人员名单:', Python-VB-C)
print('只会一种语言的人员名单:', (Python-VB-C) | (VB-Python-C) | (C-Python-VB))
print('三种语言都会的人员名单:', Python&VB&C)

img

如有帮助,望采纳!谢谢!