我正在编写一个脚本,其目标是检查每个国家/地区 ( country) 并根据索引是否存在supply列表中的条目。目标是为每个国家/地区打印出哪些条目存在和不存在。
国家:
country=['usa', 'poland', 'australia', 'china']
用于检查country朝向中的每个项目的索引supply。
# index
water_country=water_<country>_country
gas_state=gas_<country>_state
oil_city=oil_<country>_city
供应:
supply=['water_usa_country', 'gas_usa_state', 'oil_usa_city', 'water_poland_country', 'gas_poland_city', 'gas_australia_state']
对于上述情况,结果将出现在每个国家/地区的列表中:
For country 'usa' all entries exist
For country 'poland' following entries does not exist:
oil_poland_city
For country 'australia' following entries does not exist:
water_australia_country
oil_australia _city
For country 'china' following entries does not exist:
water_china_country
gas_china_state
oil_china_city
富国沪深
素胚勾勒不出你
相关分类