Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes
asked in CSC201 Spring 2021 by (8 points)

3 Answers

+4 votes

I usually use .ljust() or .rjust() to right or left justify something. Put a number in the parentheses for the amount of characters. It takes some trial and error.

answered by (8 points)
+1

This is okay, but we learned about f-strings in class and they are more convenient once you get comfortable with them.

+4 votes

Use f-strings with width field specifiers, like:

print (f"{lastName:14} {firstName:12} ...")
answered by (302 points)
+4 votes

you can also use > number or < number after colon to indicate the space from the left and from the right,
Hope that helps

answered by (8 points)
...