how to append key and values in dictionary from user in pyhton code example
Example 1: python dictionary add key-value pair
dict = {'key1':'value_one', 'key2':'value_two'}
dict['key3'] = 'value_three'
Example 2: Python dictionary append
# to add key-value pairs to a dictionary:
d1 = {
"1" : 1,
"2" : 2,
"3" : 3
} # Define the dictionary
d1["4"] = 4 # Add key-value pair "4" is key and 4 is value
print(d1) # will return updated dictionary