Given a list of tuples for parameter names and values e.g.:
[("foo", 10), ("bar", None), ("baz", "some_string")]
and some url string e.g.:
"/some/url/string"
my function should be able to create following output string (Note that None value tuples are not included in the query string):
"/some/url/string?foo=10&baz=some_string"
I tried using join but since the values are not all strings, I would have to convert them first. Maybe someone can help me with a short and clean way of doing this.
1 Answer