例:#生成一个字典
d = {'title':'abc','age':18}


if 'title' in d.keys():
  print('存在')
else:
  print('不存在')

 

if 'title' not in d.keys():
  print('不存在')
else:
  print('存在')

相关文章:

  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2021-07-16
  • 2021-11-14
  • 2022-03-07
  • 2022-12-23
  • 2021-06-12
相关资源
相似解决方案