if 'a' in dict:
dict['a'] do something
if 'b' in dict:
dict['b'] do something
# After checking the above two if statements, run the else statement below
else:
dict do something
I'd like to check if 'a' or 'b' in dict. If I use elif statement, then checking 'b' would be skipped if 'a' is in dict.
Is it possible to check the above 2 cases, if both 'a' and 'b' not in dict, then we else to do something else?
I can implement it in a tedious way though.
if `'a' or 'b'` in dict:
if 'a' in dict:
dict['a'] do something
if 'b' in dict:
dict['b'] do something
else:
dict do something