I'm stuck on a part of a looping question. I have to remove from list1 all instances of "number". So lets say list1 is (1,2,3) and num is 2. The list I would have to return would be (1,3)
def remove(list1,num)
list1=list1
num = num
This is what is given. So far, I have this:
def remove(list1,num)
list1=list1
num=num
if num in list1:
This is where I'm stuck because I don't know how to say in coding "remove num from list" I am not allowed to use .remove either.
Would appreciate the help.