Source Code:
(back to article)
# Creating a dictionary my_dict = {'Name': 'John', 'Age': 25, 'City': 'New York'} # Creating another dictionary new_dict = {'Gender': 'Male', 'Occupation': 'Software Engineer'} # Adding the new dictionary to the original dictionary my_dict.update(new_dict) # Printing the updated dictionary print(my_dict)
Result:
Report an issue