需求

判断一个键在不在字典的键中



示例


d = {"name":"tom","age":16,"gender":"男"}


b = "age" in d.keys()
print(b)
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.