,不支持while循坏# 定义集合my_set={"A","B","C","B","A"}# 定义一个空集合my_set_empty=set()print(f"my_set的内容为{my_set},类型是...循环,但是支持使用for循环遍历。...for循坏遍历:# 集合的遍历# 集合不支持下标索引,所以不能用while循坏,可用for循坏set1={1,2,3}for element in set1: print(f"集合的元素有{element...3.在for循环中将列表的元素添加至集合4.最终得到元素去重后的集合对象,并打印输出my_list = ['新闻', '传播', '新闻', '传播', 'Hi', 'Python', 'Hi', 'Python...', 'best']# 定义一个空集合my_set=set()# 通过for循坏遍历列表for element in my_list: # 在for循坏中将列表元素添加至集合 my_set.add