if 'name' in mydict:
is the preferred, pythonic version. Use of has_key() is discouraged, and this method has been removed in Python 3.
if 'name' in mydict:
is the preferred, pythonic version. Use of has_key() is discouraged, and this method has been removed in Python 3.