I am wondering how I would go about doing a validation check to see if a dictionary contains a list with another dictionary inside the list? Here is my dictionary that I need to validate: {‘custom_orders’: [{‘190’: 3}, {‘191’: 2}]}
>Solution :
If you just need to check if a list contains dictionaries and nothing else you can try this:
list_to_test = [{'190': 3}, {'191': 2}]
all((map(lambda e: isinstance(e, dict), list_to_test)))