checking whether a var is empty or not

Bart Nessux bart_nessux at hotmail.com
Thu Jul 29 21:29:06 EDT 2004


Are these equivelent? Is one approach prefered 
over the other

#check to see if var contains something... if so 
proceed.
if var is not None:
     continue

#check to see if var is empty... if so prompt user 
again.
if not var:			
    print "Please specify the amount."
    ...



More information about the Python-list mailing list