0

So, the problem is that i am printing character using python's print() functions.

print("hello world \b\bs", end='', flush=True)

But it doesn't print hello worls rather it prints hello world.

I think "\b" makes the cursor go back one character and delete that one. Above we have a space between 'd' of the 'world' and '\b\bs' that's why i used two backspace's.

Delete last printed character python above ans doesn't work!

wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • Does this answer your question? [Delete last printed character python](https://stackoverflow.com/questions/42313277/delete-last-printed-character-python) – CodeLikeBeaker Mar 21 '21 at 16:16
  • I can't reproduce the issue on Gnome-Terminal on Linux, so I'm guessing this issue is specific to Windows/Windows Console. Does `s` not appear at all in the output? Do you have another console system you could test on, like Windows Terminal, WSL, IDLE, Spyder, and/or Git Bash? – wjandrea Mar 21 '21 at 18:10
  • @wjandrea I don't know how but now it is working. – Shoaib Wani Mar 22 '21 at 04:11

0 Answers0