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

 

amgreyson@gmail.com > removeAll
prev  |  next  |  chance

Given an element and a list, return a new list from which all occurrences of the element have been removed. Implement an iterative (non-recursive) solution.


removeAll('a', ['a', 'a', 'a', 'h', 'a', 'a', 'i', 'a', '!', 'a']) → ['h', 'i', '!']
removeAll(5, [1, 2, 5, 5, 4, 6]) → [1, 2, 4, 6]
removeAll(10, []) → []

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

def removeAll(element, aSequence):

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

Difficulty: 200

Copyright Nick Parlante 2017 - privacy