In the second iteration, d
will be {'a': 'bonjour monde'}
, which doesn't have the key b
.
d.get('b')
will return None
as dict.get
will return None
if the key is not found. And in
operator treats the RHS as an iterable. That is why you are getting this error.
You can simply avoid that, like this
for d in dictlist:
if 'b' in d and 'Bond' not in d['b']: