0

I have a nested list:

groups = [['abc', 'def', 'ghi'], ['jkl', 'mno'], ['mno', 'pqr', 'stu', 'vwx']]

The dictionary:

respective_numbers = {'abc': 33,'def': 33,'ghi': 32, 'jkl': 11, 'mno': 9,'pqr': 8, 'stu': 6,'vwx': 3}

I start the function with

def enough_numbers(groups, respective_numbers):

I want a function which checks all lists out of the nested list and if these lists have a (corresponding) value from the dictionary above 67 that that list gets printed. In this case the list that gets printed is

['mno', 'pqr', 'stu', 'vwx']
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • What does "have a (corresponding) value from the dictionary above 67" mean? Nothing has a value above 33 in your dictionary. – Scott Hunter Sep 14 '22 at 16:28
  • I would start here and then iterate the flattened list against your dictionary keys: https://stackoverflow.com/questions/2158395/flatten-an-irregular-arbitrarily-nested-list-of-lists – C. Cooney Sep 14 '22 at 17:00

0 Answers0