I have a project of converting one database to another. One of the original database columns defines the row\'s category. This column should be mapped to a new category in t
>>> monty={ ('parrot','spam','cheese_shop'): 'sketch', ('Cleese', 'Gilliam', 'Palin') : 'actors'} >>> item=lambda x:[z for y,z in monty.items() if x in y][0] >>> >>> item("parrot") 'sketch' >>> item("Cleese") 'actors'
But let me tell you, It will be slow than normal one to one dictionary.