I have a dictionary of values like this:
indicator_keys = {
'i2': 'bla bla',
'i4': 'bla bla bla',
'i5': 'bla bla bla bla',
'i6': 'bla bla bla bla bla'
}
and I have a list like this :
a = ['i2','i4','i5','i6','i15']
b = ['i6','i3','i10','i6','i15']
I want to run a loop that will go through the dictionary and match if the item from my list matches one of the key to print the proper value but every loop I try even if there is only 1 match will prints the same sentence as the length of the WHOLE list (for example if only i2 matched he will print the value 5 times because of the For loop) this is my code so far:
for index, key in enumerate(indicator_keys):
for i in a:
if str(i) in indicator_keys:
print(indicator_keys[str(i)])
for s in b:
if str(s) in indicator_keys:
print(indicator_keys[str(s)])