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

 

david.white@denison.edu cs111fall2019 > remove_better
prev  |  next  |  chance

Write a function remove(data, value) that returns a new list that contains the same elements as the list data except for ones that equal value. Note that, unlike the built-in remove method, your function should remove ALL items equal to value. For example, remove([3, 1, 5, 3, 9], 3) should return the list [1, 5, 9].


remove_better([1, 1, 1, 1, 1, 1, 1, 1, 1], 1) → []
remove_better([1, 2, 3, 4, 5, 6, 10, 8, 9], 1) → [2, 3, 4, 5, 6, 10, 8, 9]
remove_better([3, 2, 3, 4, 5, 3, 10, 3, 9], 3) → [2, 4, 5, 10, 9]

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

def remove_better(data,value):

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