PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Python program to show working
# of has_key() method in Dictionary
# Dictionary with three items
Dictionary1 = {'A': 'Geeks', 'B': 'For', 'C': 'Geeks'}
# Dictionary to be checked
print("Dictionary to be checked: ")
print(Dictionary1)
# Use of has_key() to check
# for presence of a key in Dictionary
print(Dictionary1.has_key('A'))
#print(Dictionary1.has_key('For'))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run