I’m pretty new and have no idea what the syntax should be… best i got is
mydict={‘John’ : ‘House’, ‘Eric’ : ‘Turtle’, ‘Jimmy’ : ‘John’, ‘Charles’ : ‘Eric’}
myresult={}
for x,y in mydict.items():
if y in mydict:
myresult.update({x,y})
which obviously doesn’t work otherwise i wouldn’t be posting here. This was copy and pasted from Jupytr so formatting may be off after submission