Python 3
urllib.parse.urlencode(query, doseq=False, [...])
Convert a mapping object or a sequence of two-element tuples, which may contain str or bytes objects, to a percent-encoded ASCII text string.
— Python 3
urllib.parsedocs
A dict is a mapping.
Legacy Python
urllib.urlencode(query[,doseq])
Convert a mapping object or a sequence of two-element tuples to a “percent-encoded” string… a series ofkey=valuepairs separated by'&'characters…
— Python 2.7
urllibdocs