python的print(" ")换行问题

print(" ")执行后,默认换行,光标停留在下一行.

要让print(" ")执行输出后不换行,方法:print("XXXXX ",end=" ")

原因:print(" ")之所以换行是因为print里的字符串""的最后一个end为/n,即换行,要使其不换行,只需改变end即可

posted on 2019-01-21 13:14  萤火虫是森林的泪  阅读(19474)  评论(0)    收藏  举报