更新时间:2022-06-15 09:52:26
在 print
函数中使用 end
参数,就像这样
Use end
parameter in print
function, like this
print(line_number, a_line, end="")
print
的默认参数列表函数如下所示,
The default list of parameters to print
function looks like this,
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
由于 end
具有 \ n
,因此每次调用 print
后都会插入新行.
Since end
has \n
, a new line will be inserted after every print
call.