Removing elements from lists


#1

n = [1, 3, 5]
# Remove the first item in the list here
n.pop(0)
n.remove(1)
del(n[0])
print n

 Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: list.remove(x): x not in list

can't figure out mates..


#2

you only need to remove the first item? no need to use three different methods, this means multiply items get removed from the list

the error is caused by remove, since you pop the first item, remove has a problem, remove doesn't use index, but instead uses items in the list, but since you already popped, 1 is no longer in the list


#3

oh god you're right mate.. besides in the instructions it's saying use.. either of the functions given .pop(), .remove(). del()

thanks though