Python输出0和多个x0,用制表符隔开
可以使用字符串格式化来实现,具体代码如下:
functions = [1, 2, 3, 4, 5]
x0_count = len(functions)
x0_str = '\t'.join(['x0' for i in range(x0_count)])
print(f'0\t{x0_str}\n')
输出结果为:
0 x0 x0 x0 x0 x0
原文地址: https://www.cveoy.top/t/topic/lJjh 著作权归作者所有。请勿转载和采集!