I want to write a function that will remove a certain integer from a list. Both of the values are input. For example, removeValues([1, 2, 3], 3)
would return the list [1, 2]
:
def removeValues(aList, n):
newList = []
if n in aList:
aList.remove(n)
newList.append(aList)
else:
return False
I am not sure if .remove
is the right way to go.