-1

Hi I have a simple code:

for i in range(0, 10):
    print '\b*' 

outputs:

*

*

*

*

*

*

*

*

* 

*

however when I add a comma at the end like so:

for i in range(0, 10):
    print '\b*' ,

Output is:

**********

What exactly is the comma doing here with respect to \b??

1 Answers1

1

Follow the docs here

A '\n' character is written at the end, unless the print statement ends with a comma.

khelwood
  • 55,782
  • 14
  • 81
  • 108
MohitC
  • 4,541
  • 2
  • 34
  • 55