Short answer, I'm sure someone will come up with a dissertation later on.
**D
here means that dictionary D
will be used to fill in the "named holes" in the string format. As you can see, {say}
got replaced by 5
and {get}
got replaced by shrubbery
.
Actually, it is the same mechanism as the one used for passing an arbitrary number of parameters to a function; format
expects as many parameters as the "holes" in the string. If you want to wrap them up in a dictionary, that's how you do it.
For more information, check keyword arguments and unpacking, in Python's documentation, as Prashant suggested.