# Create an empty dictionary
my_dict = {}
# Add key-value pairs to the dictionary
my_dict['name'] = 'John'
my_dict['age'] = 30
my_dict['country'] = 'USA'
# Access and print values from the dictionary
print(my_dict['name']) # Output: John
print(my_dict['age']) # Output: 30
print(my_dict['country']) # Output: USA
# Update the value of a key
my_dict['age'] = 31
# Remove a key-value pair from the dictionary
del my_dict['country']
# Check if a key exists in the dictionary
if 'city' in my_dict:
print("City:", my_dict['city'])
else:
print("City key does not exist.")
# Print all key-value pairs in the dictionary
for key, value in my_dict.items():
print(key, ":", value)