A quick question using python -
When we use remove() method in list and the set we get different error one is giving Value error and other one return key error, is there any specific reason??
s = [10,20,30,40]
s.remove(50)
print(s)
Traceback (most recent call last):
s.remove(50)
ValueError: list.remove(x): x not in list
-------------------------------------------
s = {10,20,30,40}
s.remove(50)
print(s)
Traceback (most recent call last):
s.remove(50)
KeyError: 50