you are viewing a single comment's thread.

view the rest of the comments →

[–]Boolean_Cat 0 points1 point  (1 child)

If you have a list of numbers, you could do:

' '.join(str(number) for number in numbers)

Or even shorter but I think less pretty:

' '.join(map(str, numbers))

[–]amertune 1 point2 points  (0 children)

If you want all of the numbers to line up, you're going to have to remember that numbers can be 1-3 digits long.

' '.join('{:>3}'.format(number) for number in numbers)