decisions = [ {'number': 1, 'A': {'self': 15, 'other': 5}, 'B': {'self': 5, 'other': 15}}, {'number': 2, 'A': {'self': 6, 'other': 5}, 'B': {'self': 5, 'other': 6}}, {'number': 3, 'A': {'self': 5, 'other': 10}, 'B': {'self': 10, 'other': 5}}, {'number': 4, 'A': {'self': 10, 'other': 12}, 'B': {'self': 12, 'other': 10}}, ] decisions_by_type = { 1: {'A': "selfhigher", 'B': "otherhigher"}, 2: {'A': "selfhigher", 'B': "otherhigher"}, 3: {'A': "otherhigher", 'B': "selfhigher"}, 4: {'A': "otherhigher", 'B': "selfhigher"}, } def decision_corresponding_type(item, choice): """ Get the choice type which corresponds to the choice a person made. params: The choice taken (A or B) and the item on which the choice was taken returns: The choice type corresponding to this choice for this item effects: None """ return decisions_by_type[item][choice]