79510806

Date: 2025-03-15 08:21:16
Score: 0.5
Natty:
Report link

OK, as pointed out by several people above, the trick was not actually done by print(), it was done by the terminal itself to which print() was sending the string. I didn't realize that part, now it makes more sense. Thanks to all who pointed that out!

So, in the end, I will just treat it as a usual string manipulation case. Something like this:

i = mystr.rfind('\r')
newstr = mystr[i+1:]

It also works when the string doesn't contain '\r', because rfind() returns -1 in that case.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Dmitry Perets