+ 1
Please do complete it.
The skip_elements function returns a list containing every other element from an input list, starting with the first element. Complete this function to do that, using the for loop to iterate through the input list. def skip_elements(elements): #Initialize variables new_list = [ ] # 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 []
4 Antworten
+ 6
I would recommend you to work through the python tutorial from sololearn. Thanks!
+ 2
I need to fillup the blank spaces but it showing error.
+ 1
This is the question and answer section.
What's your question?🙂🙂