Given the following code:
d = {'a':1, 'b':2}
if not 'c' in d:
print 'kaboom'
if 'c' not in 'd':
print 'kaboom'
In both cases this prints 'kaboom'. What is the difference and why PEP8 complains about the former.
Given the following code:
d = {'a':1, 'b':2}
if not 'c' in d:
print 'kaboom'
if 'c' not in 'd':
print 'kaboom'
In both cases this prints 'kaboom'. What is the difference and why PEP8 complains about the former.