# when the key is missing, setdefault returns the default and updates the dictionary accordingly. d = {}d.setdefault('name', 'N/A')d['name'] = 'Gumby'd.setdefault('name', 'N/A')print d
Name (required)
email (will not be published) (required)
Website