def skip_elements(elements) :
new_list = []
for i in elements :
if i % 2 == 0 :
new_list= new_list.append(i)
i+=1
else :
i+=1
return new_list
print(skip_elements(["a", "b", "c", "d", "e", "f", "g"])) # Should be ['a', 'c', 'e', 'g']
print(skip_elements(['Orange', 'Pineapple', 'Strawberry', 'Kiwi', 'Peach'])) # Should be ['Orange', 'Strawberry', 'Peach']
print(skip_elements([])) # Should be []
倚天杖
相关分类