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 sequence (either a string or a list), return a new sequence from which all occurrences of the element have been removed. Implement a recursive solution.


removeAll('a', 'aaahaaia!a') → 'hi!'
removeAll('a', ['a', 'a', 'a', 'h', 'a', 'a', 'i', 'a', '!', 'a']) → ['h', 'i', '!']
removeAll('b', 'bcbcbc') → 'ccc'

...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 Post-solution available

Copyright Nick Parlante 2017 - privacy