sample_dict = {'physics':82,'maths':65,'history':75}
minimum_value = min(sample_dict.values())
minimum_keys = [key for key in sample_dict if sample_dict[key]==minimum_value]
print(minimum_keys)
['maths']
sample_dict = {'a':100, 'b':200, 'c':300}
value = 200
if value in sample_dict.values():
print(f"Yes, Value: '{value}' exists in dictionary")
else:
print(f"No, Value: '{value}' does not exists in dictionary")
Yes, Value: '200' exists in dictionary
dict1 = {'ten':10, 'twenty':20, 'thirty':30}
dict2 = {'thirty':30, 'forty':40, 'fifty':50}
dict1.update(dict2)
print('updated dictionary:')
print(dict1)
updated dictionary: {'ten': 10, 'twenty': 20, 'thirty': 30, 'forty': 40, 'fifty': 50}