首页 > 解决方案 > Carriage return does not work with me correctly

问题描述

Carriage return or \r works as you have shifted your cursor to the beginning of the string or line. so, whenever you will use this special escape character \r, the rest of the content after the \r will come at the front of your line and will keep replacing your characters one by one until it takes all the contents left after the \r in that string. right???

However, with me it only prints what is after \r so,

print("don't wish for it work \r for it")

print only "for it"

标签: pythoncarriage-return

解决方案


尝试:


print("don't wish for it work \n for it")


推荐阅读