Suppose I have a string like this:
s="b a[1] something funny"
and I have these variables
b="10"
a=["1","is"]
is it possible for me to somehow replace values in the first string with values from my variables, hopefully with one function. I don't want to execute the string with eval because it contains invalid Python code.
s..format()would help :s = "{} {} something funny".format(b,s[0])