I have a dictionary which its keys has multiple values, I have a list which some of its items are values from the dictionary and some are not. what I'm trying to do is to read every item in that list and if it was a value in the dictionary, append the key pair of it to another list and if it wasn't append the item itself, but I keep get nothing
d = {'salam':('hi', 'ciao', 'bonjour'), 'mamnoon':('thanks', 'grazie', 'merci')}
l = ['hi', 'thanks', 'very', 'much']
l1 = []
for i in range(0, len(l)):
search_val = l[i]
for key, val in d.items():
if val == search_val:
l1.append(key)
else:
l1.append(l[i])
print(l1)
the output that I'm looking for is this but I keep receiving an empty list
['salam', 'mamnoon', 'very', 'much']