provinces =["山东","四川"]
cities =[["临沂","济南","青岛"],["重庆"]]# print(cities[0])
op =eval(input("请输入您要进行的操作,0 表示查询省对应的城市,1表示查询城市对应的省"))if op ==0:findp =input("请输入您要查询省")if findp in provinces:ind = provinces.index(findp)print(cities[ind])else:print("抱歉,您查询的省不在列表内")else:f =0findc =input("请输入您要查询的城市")l =len(cities)for i inrange(len(cities)):if findc in cities[i]:print(provinces[i])f =1breakif f ==0:print("抱歉,您查询的城市不在列表内")