Is there a simple way of passing a list as the parameter to a string substitution in python ? Something like:
w = ['a', 'b', 'c']
s = '%s\t%s\t%s\n' % w
Something similar to the way dictionaries work in this case.
Just convert the list to a tuple:
w = ['a', 'b', 'c']
s = '%s\t%s\t%s\n' % tuple(w)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With