BASE_URL = 'http://foobar.com?foo=%s'
variable = 'bar'
final_url = BASE_URL % (variable)
I get this 'http://foobar.com?foo=bar'
# It ignores the inside string.
But i wanted something like this 'http://foobar.com?foo='bar''
Thanks for the answer.
Can you help me out with almost the same problem:
lst = ['foo', 'bar', 'foo bar']
[str(l) for l in lst if ' ' in l]
I get ['foo bar']
but i wanted it like [''foo bar'']
Thanks in advance.