⬅︎ Back to Case insensitive list remove call
How about this? Oops: I almost had time to be the first!def ss_remove(lst,el): return [e for e in lst if ss(e) != ss(el)]L = list('ABC')L = ss_remove(L, 'c') # will workprint L # prints ['A','B']
Comment
How about this? Oops: I almost had time to be the first!
def ss_remove(lst,el):
return [e for e in lst if ss(e) != ss(el)]
L = list('ABC')
L = ss_remove(L, 'c') # will work
print L # prints ['A','B']