Logo

Programming-Idioms

History of Idiom 172 > diff from v28 to v29

Edit summary for version 29 by s:
[Python] s

Version 28

2021-01-10, 20:49:14

Version 29

2021-01-25, 07:46:01

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
m[k] = v
Code
print('jk')
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