Source Code:
(back to article)
# Creating a dictionary my_dict = {'Name': 'John', 'Age': 25, 'City': 'New York'} # Adding a new element my_dict['Gender'] = 'Male' # Printing the updated dictionary print(my_dict)
Result:
Report an issue