Python连接两个集合的时候怎么只保留重复项?#Python2022-05-26 21:59分类:Python 0 条评论 请先 登录 后评论 默认排序 时间排序 1 个回答|284 次阅读 2022-05-26 22:02 Coco老师 - 官方公众号:青少儿编程学习网 擅长:编程教育 • 网站:https://kidscodes.cn/intersection_update()方法将仅保留两个集中重复的项。保留集合中存在的重复项"apple":x = {"apple", "banana", "cherry"}y = {"google", "microsoft", "apple"}x.intersection_update(y)print(x)执行结果:{'apple'} 请先 登录 后评论