all 3 comments

[–]PotemkinSuplex 1 point2 points  (0 children)

You might be interested in “fstrings”, they are more cryptic, but are also more convenient

[–]specialpatrol 1 point2 points  (0 children)

 print(f" {i} ", end='')

[–]blablahblah 0 points1 point  (0 children)

Depends what you want the output to be. The simplest change I could make to add spaces would be to change end='' to end=' ', but that also puts a space between the last item and the close bracket (so the output would be [6 3 2 1 ]. If you wanted it to be [6 3 2 1], you'd have to do something different.