1

I tried doing this :

a = [1,2,3]
if 68 not in a:
    print 'missing'

a = [1,2,3]
if not 68 in a:
    print 'missing'

the output is the same. But I doubt it if the two are logically the same. Is this logically the same or not? Thanks

  • 1
    If you change `68` for `1` (or `2` or `3`) do they still output the same? Does that not resolve your doubt? – OJFord Apr 17 '17 at 06:42

1 Answers1

1

Yes, they are same. This is same as how them literally means.

Even the internal comparison cost are same, probably.

Tatsuyuki Ishi
  • 3,883
  • 3
  • 29
  • 41