Appending Key-Value Pairs to Dictionaries

  • Share this:

Code introduction


Define a function that appends a key-value pair to a dictionary.


Technology Stack : Dictionary

Code Type : Function

Code Difficulty :


                
                    
def append_to_dict(original_dict, new_key, new_value):
    original_dict[new_key] = new_value                
              
Tags: