I am defining a list of dictionaries and I need to print only the one dictionary based on my input in check_if_in_list
first_list = {'a':'1','b':'2'}
second_list = {'a':'10','b':'20'}
all_lists =[first_list, second_list]
for element in all_lists:
check_if_in_list = input('give a valid number')
if check_if_in_list = (item['a'] for item in all_lists):
I need something like that
print(element where item['a]=check_if_in_list)
for example if I enter '1' in input in check_if_in_list
, the print should be :
{'a':'1','b':'2'}