How to check if a value exists in a dictionary if the value is a list with Python

1 Answer

0 votes
dict = {1: ['a', 'b'],
        2: ['c', 'd'],
        3: ['e', 'f'],
        4: ['g', 'h'],
        5: ['i', 'j']}

print(['e', 'f'] in dict.values())


    
    
'''
run:

True

'''

 



answered Apr 11, 2021 by avibootz

Related questions

1 answer 166 views
2 answers 220 views
1 answer 181 views
1 answer 161 views
2 answers 152 views
1 answer 173 views
1 answer 149 views
...