How do you add key: value pairs to an existing dictionary?
Answers
Answered by
1
Answer:
Python Program to Add a Key-Value Pair to the Dictionary
Take a key-value pair from the user and store it in separate variables.
Declare a dictionary and initialize it to an empty dictionary.
Use the update() function to add the key-value pair to the dictionary.
Print the final dictionary.
Exit.
Similar questions