Suppose you have a hash ‘sample_hash’,
sample_hash = { “a” => 1}
Adding a new element would be :-
sample_hash[“b”] = 2
—————————————————————–
Deleting an element would be :-
sample_hash.delete(“b”)
Advertisements
Suppose you have a hash ‘sample_hash’,
sample_hash = { “a” => 1}
Adding a new element would be :-
sample_hash[“b”] = 2
—————————————————————–
Deleting an element would be :-
sample_hash.delete(“b”)