Warning! It seems that you are using Dodona within another webpage, so not everything may work properly. Let your teacher know so that he can solve the problem by adjusting a setting in the learning environment. In the meantime, you can click this link to open Dodona in a new window.
Warning! The page was not fully loaded, probably because of a network issue. It could be that not all functionalities work as expected. Please try reloading the page.
Remove all
Sign in to test your solution.
# Functies:
def remove_all(lijst, item):
"""
Deze functie verwijdert alle items met de waarde van parameter item
uit een lijst.
inputparameters:
lijst: een list.
item: een item (mag elk datatype hebben).
returnwaarde:
lijst: de aangepaste lijst.
(Voor de kritische leerling: deze lijst hoeft eigenlijkt niet
gereturnd te worden, omdat hij binnen deze functie wordt aangepast.)
"""
#SCHRIJF HIER JE OPLOSSING
return lijst
# Hoofdcode:
# DEZE CODE NIET VERANDEREN.
# (Wordt gebruikt om automatisch na te kijken.)
print(remove_all(["A","B","B","A"," ","D","E"," ", "B","A","N","D"], "A"))
print(remove_all(["A","B","B","A"," ","D","E"," ", "B","A","N","D"], "B"))
print(remove_all([-9.5,"n.a.n.",4,5,-6,-2.3,"n.a.n."],"n.a.n."))
print(remove_all([1,1,0,0,1,1,1,1,0,0], 0))
print(remove_all([1,1,0,0,1,1,1,1,0,0,2], 2))