Your no values ββare actually strings in the dictionary.
You can check "No" or use the actual None python value.
d = {'a':None,'b':'12345','c':None} for k,v in d.items(): if d[k] is None: print "good" else: print "Bad"
prints "good" 2 times
Or, if you need to use your current dictionary, just change your check to find 'None'
additionally dict is a type built in python, so it would be nice to name dict variables
source share