python3.x 实现 print 不换行

print([object...], *sep=' 'end='\n'file=sys.stdout,flush=FALSE)

python中print之后是默认换行的,是因为其默认属性 end 默认值为"\n"(\n为换行符)
print('23 祝大家天天开心', end='!')
  >>> 23 祝大家天天开心!
end就表示print将如何结束,默认为end="\n"(\n为换行符)

猜你喜欢

转载自www.cnblogs.com/HISAK/p/11622133.html