type: dict It contains all LOCALS variable names in the keys of the dict. Then it contains all values, references or object in the value.
locals()['new_vairable'] = 2
# is exactely the same as doing
new_vairable = 2Search
Jul 31, 20241 min read
type: dict It contains all LOCALS variable names in the keys of the dict. Then it contains all values, references or object in the value.
locals()['new_vairable'] = 2
# is exactely the same as doing
new_vairable = 2