whats the difference between "is not" and " !=" in Python [duplicate]
Possible Duplicates:
Is there any difference between “foo is None” and “foo == None”? Python '==' vs 'is' comparing strings, 'is开发者_运维问答' fails sometimes, why?
Hi, im doing some checks on argvs in python and running from the windows cmd
python script.py 2.zap
This works(rises the desired Exception):
from sys import argv
if argv[1][-3:] != "zip":
raise Exception()
But this doesnt
from sys import argv
if argv[1][-3:] is not "zip":
raise Exception()
Could you explain the difference, thanks in advance. I'm using python 3 if thats relevant.
精彩评论