Python noob so I might be going about this the wrong way
I want to use a try/except block to find if a value in a dict isn’t set like
try:
if entry['VALUE1'] == None: void()
if entry['VALUE2'] == None: void()
except KeyError:
print "Values not Found"
Of course the ‘void’ function doesn’t exist, is there anything I can do to get round this so that code will work properly
Try replacing
void()withpass.Of course, in practice, you can just do
if key in some_dict:. But if you ever need a “do nothing” in a block,passis what you’re looking for.