Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultvaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: update
Description
Updates the dictionary with the key/value pairs from other, overwriting existing keys.
Extended Description
The update() method updates the dictionary with elements from another dictionary or an iterable of key/value pairs. If a key from the other dictionary already exists in the current dictionary, its value is overwritten. If a key doesn't exist, a new key-value pair is added. This method modifies the dictionary in place and doesn't return a value. It can also accept keyword arguments for adding new key-value pairs.
Function Signature
dict.update(other: Union[dict, Iterable[Tuple[Any, Any]]], **kwargs) -> None
Module: dict
Class: dictionary
Parameters
Parameter List
- other: Union[dictionary, Iterable[Tuple[Any, Any]]]
Return
This method doesn't return a value (None).
Return Type
None
Output
Explanation
This example shows how update() merges two dictionaries, overwriting existing keys.