慕沐林林
# -*- coding:utf-8 -*-user = [
{"name":"Yang","weight":55,"height":172,"ID":1},
{"name":"Liu","weight":54,"height":171,"ID":2},
{"name":"Pan","weight":52,"height":170,"ID":3}
]# 这里的ID是顺序增加的Query = int(input("输入一个数字:"))# 这里判断Query是否等于user列表字典的某一个字典的ID值Flag = Falsefor item in user: if Query == item['ID']:
Flag = True
breakif(Flag):
print('存在')else:
print('不存在')