Logo

Programming-Idioms

History of Idiom 172 > diff from v29 to v30

Edit summary for version 30 by programming-idioms.org:
Restored version 28: No.

Version 29

2021-01-25, 07:46:01

Version 30

2021-01-25, 20:11:51

Idiom #172 Insert entry in map

Insert value v for key k in map m.

Idiom #172 Insert entry in map

Insert value v for key k in map m.

Variables
v,k,m
Variables
v,k,m
Extra Keywords
associative
Extra Keywords
associative
Code
print('jk')
Code
m[k] = v
Comments bubble
If m[k] already exists, then it is overwritten.
Comments bubble
If m[k] already exists, then it is overwritten.
Doc URL
https://docs.python.org/tutorial/datastructures.html#dictionaries
Doc URL
https://docs.python.org/tutorial/datastructures.html#dictionaries