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))
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.
Python sandbox
This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.