[i for i in my_list if '91' not in i and '18' not in i]
Note you shouldn’t use list
as a variable name, it shadows the built-in function.
[i for i in my_list if '91' not in i and '18' not in i]
Note you shouldn’t use list
as a variable name, it shadows the built-in function.