是否可以将以下两个语句合并为一个语句?
f.write(",".join(str(cell) for cell in row))
f.write("\n")
最佳答案
只需将 join
的结果与 '\n'
f.write(",".join(str(cell) for cell in row) + '\n')
关于python - 将两个语句合并为一个语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26193335/