标签: python list
birds = ["turkey", "hawk", "chicken", "dove", "crow"] bird = [] for animal in birds: if animal.startswith("c"): birds.remove(animal) else: bird.append(animal) print (birds) print (bird)
为什么鸟和鸟的结果不同?!?!