id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

konstans@stuy.edu > stripList
prev  |  next  |  chance

Given a data list, and a list of elements that are to be removed, modify the data list as follows: Remove all elements at the start of the list that are contained in the thingsToRemove up until the first(leftmost) element that is not contained in the list. Then repeat for all elements at the end of the list, stopping at the rightmost element that does not meet the removal criteria.


stripList([1, 1, 1, 5, 4, 1, 1, 1], [1]) → [5, 4]
stripList([1, 1, 1, 4, 1, 1, 1], [1]) → [4]
stripList([1, 1, 1, 1, 1, 1], [1]) → []

...Save, Compile, Run (ctrl-enter)

def stripList( data, thingsToRemove ):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy