Thursday, August 2, 2007

use * for string duplication

I have not used * operation to duplicate string until recently:
valueStr2 "( %s" + ",%s"*(len(dict)-1)+")"

rather than the following c-type implementation
tempL = []
for i in dict.keys():
tempL.append("%s")
valueStr2 = "(" + ",".join(tempL)+")"