#create a tuple tuplex = "w", "j" ,"c", "e" print(tuplex) #tuples are immutable, so you can not remove elements #using merge of tuples with the + operator you can remove an item and it will create a new tuple tuplex…
1.需求 num = [1,2,2,2,3,4,2,2,2,2,2,2,22,2]把列表中的有2的元素全部删除 2.编程代码 nums = [1,2,2,2,3,4,2,2,2,2,2,2,22,2]print("打印删除前的元素:")print(nums)temp = []for i in nums: if i !=2 and "2" is not str(i): temp.append(i)print("打印删除后的元素:&quo…