13 Feb
2013
13 Feb
'13
8:56 a.m.
On 13.02.13 15:17, Daniel Holth wrote:
On Wed, Feb 13, 2013 at 7:10 AM, Serhiy Storchaka
mailto:storchaka@gmail.com> wrote: I prefer "x = '%s%s%s%s' % (a, b, c, d)" when string's number is more than 3 and some of them are literal strings. Fixed: x = ('%s' * len(abcd)) % abcd
No, you don't need this for the constant number of strings. Because almost certainly some of strings will be literals, you can write this in a more nice way. Compare: 'config[' + key + '] = ' + value + '\n' ''.join(['config[', key, '] = ', value, '\n']) 'config[%s] = %s\n' % (key, value)