-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
  • 52,115
  • 13
  • 74
  • 94
MohitC
  • 3,952
  • 1
  • 29
  • 49