Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If I correctly understand your question, dictionaries can do this. You just need to use tuples as keys. Example:

sage: m = {} # an empty dictionary
sage: m[('Cathy', 19)] = '555-1212'
sage: m[('Cathy', 19)]
'555-1212'