Take a look at the data model of python. Dictionaries and lists are mutable objects, which is why globally defined dictionaries for example do not need to be declared global. Their contents may be changed at any time.
To understand mutability, think of the strings in python. They are an immutable object. You can for example replace the contents of a given string but in doing so the interpreter creates a new string object, and thus gives this string object a new identity (and thus a memory address).
>>> s = "foo"
>>> id(s)
140202745404072
>>> s = "bar"
>>> id(s)
140202745404112
I've answered a few similar questions before, so take a look if you can find more information from them.
dis mutable and the operation you performed ondinside dictionary is not be considered as an assignment operation by functions. For example with lists(mutable object)+=operator will raise error in function body, but .append and .extend and assignment by index will work fine.x = y) to a variable inside a function, python implicitly decides you're referring to a local. The syntaxd[k] = xresolves to a__setitem__call - so while it looks syntactically like assignment, it is not.