【发布时间】:2018-12-08 12:59:39
【问题描述】:
我想检查a的值是否存在于b值中
a = [{ "shopid": "store4400013","prd_category": "Chicken","product_id":"4359197","prd_name":"Chicken chilli","prod_type":"Non_Veg","prd_amt":"100.0"}]
b = [{'shopid': 'store4400013', 'prd_category': 'Chicken', 'product_id': 4359197, 'prd_name': 'Chicken chilli', 'prod_type': 'Non_Veg', 'prd_amt': 100.0, 'image': '/media/abhishek/e/Moneypay/merchant/mxuserimage/menu_3418906783.png'}, {'shopid': 'store4400013', 'prd_category': 'Chicken', 'product_id': 6911213, 'prd_name': 'Chicken kadai', 'prod_type': 'Non_Veg', 'prd_amt': 250.0, 'image': '/media/abhishek/e/Moneypay/merchant/mxuserimage/menu_3890935432.png'}]
【问题讨论】:
-
value of a是什么意思?是否存在需要相同的特定键值对? -
对不起,我的意思是变量 a 和变量 b
-
为什么要列出一本字典?
-
@RoadRunner..因为我得到变量 a 作为响应并且列表中会有任何数字字典
标签: python django python-3.x django-rest-framework