I have list of dictionaries
teachers = [
{
"id": 0,
"goals": ["travel", "relocate", "study"],
},
{
"id": 1,
"goals": ["travel","study"],
},
{
"id": 2,
"goals": ["travel", "work", "study"],
},
{
"id": 3,
"goals": ["work", "relocate", "study"],
}
]
I need to get part of dictionary where in "work" is in list in "goals" :
teachers = [
{
"id": 2,
"goals": ["travel", "work", "study"],
},
{
"id": 3,
"goals": ["work", "relocate", "study"],
}
]
How should I solve my problem?