Deletion from dictionary

Question

Delete Honda from the dictionary below.

Cars={

“Hyundai”:”Creta”,

“Honda”:Civic,

“Jeep”:”Compass”

}

in progress 0
Anonymous 55 years 3 Answers 704 views 0

Answers ( 3 )

  1. You may use this->
    del Cars[“Honda”]

  2. #pop() : Removes the element from dictionary with the specified key
    Cars.pop(“Honda”);

Leave an answer

Browse
Browse