【发布时间】:2020-10-02 14:44:12
【问题描述】:
我的程序在每一行之后打印一个额外的空格。我想删除每行末尾的多余空格。
x, y = map(int, input().split())
count = 0
while count < (y//x):
start = count*x + 1
end = (count + 1) * x + 1
for i in range(start,end,1):
print(i,end=" ")
print("")
count+=1
输入: 3 99
输出:
1 2 3
4 5 6
7 8 9
.....
每行结束后我打印了一个额外的空格,我怎样才能删除这个空格?
【问题讨论】:
标签: python python-3.x output