执行以下代码段pets = [dog, cat, dog, goldfish, cat, rabbit, cat]while cat inpets: pets.remove(cat)print(pets)时,输出为( )。
(A)['dog', 'cat', 'dog', 'goldfish', 'cat', 'rabbit', 'cat']
(B)['dog', 'dog', 'goldfish', 'rabbit']
(C)['dog','dog', 'goldfish', 'cat', 'rabbit', 'cat']
(D)['dog', 'dog', 'goldfish', 'rabbit', 'cat']
参考答案
继续答题:下一题