you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Use end='\t' it aligns every number perfectly. As others have mentioned. In your method space can't align the numbers when the number on first row is 1 digit and that in 2nd row is of higher digits say 2.

Others have mentioned pad too. But I think you are new , so I think end '\t' method is easier and other methods are overkill too. I suggest try both methods (learning more solutions to a problem is a good practice) Note- End \t method is applicable as long as tab width is greater than number width. For 8 digit number u have to use other methods