Python - If not statement with 0.0
I have a question regarding if not statement in Python 2.7 . I have written some code and used if not statements. In one part of the code I wrote, I refer to a function which includes an if not statement to determine whether an optional keyword has been entered. It works fine, except when 0.0 is the keyword's value. I understand this is because 0 is one of the things that is considered 'not'. My code is probably too long to post, but this is an analogous (albeit simplified) example: def square(x=None): if not x: print "you have not entered x" else: y=x**2 return y list=[1, 3, 0 ,9] output=[]