我想知道是否有办法在python 2.7.12中做这样的事情
def saveValues(file,*data,delim="|"): buf="" for d in data: buf+=str(d) + delim open(file,"w").write(buf[:-1])
这样我就可以选择传递delim,或者采用默认值.
python arguments function python-2.7
arguments ×1
function ×1
python ×1
python-2.7 ×1