Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 26)
26.
How can you align text to the right in a Python console output?
align_right("text")
print("text", align="right")
print(f"{text:>10}")
right_align("text")
Answer: Option
Explanation:
Using the f-string format {text:>10} aligns the text to the right within a 10-character wide space.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.