Python Dictionary | check key and value exist or not

Python Dictionary | check key and value exist or not


if 'name' in user_info2:
print("prensent")
else:
print("not present")

Check value is exist in dictionary —–>

value method


if 22 in user1.values():
print('exis')
else:
print('not exist'

Python Dictionary | check key and value exist or not

Leave a Comment

Your email address will not be published. Required fields are marked *