Answers for "add new key pair to dictionary"

4

python dictionary add key-value pair

dict = {'key1':'value_one', 'key2':'value_two'}  
dict['key3'] = 'value_three'
Posted by: Guest on September-21-2020
0

how to add key value pair in object

// program to add a key/value pair to an object

const person = {
    name: 'Monica',
    age: 22,
    gender: 'female'
}

// add a key/value pair
person.height = 5.4;

console.log(person);
Posted by: Guest on December-27-2021

Code answers related to "add new key pair to dictionary"

Python Answers by Framework

Browse Popular Code Answers by Language