String Formatting

  • + 2 comments

    Without width=width, the code would not run (as format would have no idea what {width} should be set to.

    If you're asking what it does, then it tells the format function to set all {width} parts parameter to the width variable defined at line 2.

    If you're asking why {width} is there, then it tells format to space out the output of each number to the largest number string (which is found out by line 2 of the code).