def skip_elements(elements):
# Initialize variables
new_list = []
i = 0
# Iterate through the list
for ___
# Does this element belong in the resulting list?
if ___
# Add this element to the resulting list
___
# Increment i
___
return ___
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 []
评论
请
登录后发表观点
- 积分
0 - 话题
0 - 评论
3213 - 注册排名
2427