For a python dictionary is it possible to create a key that the dictionary will default to if the requested key is not present ?
Edit: I fail to understand how the solutions pointed below and above address the question
If I ask for dictionary['xxx'] where xxx is not a known value or a variable , it can be any string, how can I use dictionary['key'] and dictionary.get('key','defaultvalue')
Edit2:
spouse={John:Joan, Bob:Marry}
when I ask for spouse[Dan] I should get "not married" same should go for any male mane that comes to user's mind and it is not a key in the dictionary
I hope that now it is clearer
The defaultdict comment seems to be the only useful