family = {'father': 'John', 'mother': 'Mary', 'son': 'Jack', 'daughter': 'Jenny'}
print('Enter the key: ')
key = input()
if key in family:
print(family[key])
else:
print('The key is not in the dictionary')
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
family = {'father': 'John', 'mother': 'Mary', 'son': 'Jack', 'daughter': 'Jenny'}
print('Enter the key: ')
key = input()
if key in family:
print(family[key])
else:
print('The key is not in the dictionary')