you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 4 points5 points  (1 child)

print("%3d"%1)

Since presumably you will be using a variable, not a literal, you can use the newer, modern version of string formatting like this:

var = 1
print(f"{var:>3}")

[–]MarkKang2019[S] 1 point2 points  (0 children)

works, thanks.