Reputation: 2567
For example something like:
if l.index(a)== -1:
l += [a]
If I run something like this, I will get a value error.I am assuming this is not a new problem.
Upvotes: 2
Views: 109
Reputation: 142166
Why not just use:
if a not in some_list:
some_list.append(a)
Upvotes: 10