Q:

Write a Python program to display a number in left, right and center aligned of width 10

0

Write a Python program to display a number in left, right and center aligned of width 10.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

x = 22
print("\nOriginal Number: ", x)
print("Left aligned (width 10)   :"+"{:< 10d}".format(x));
print("Right aligned (width 10)  :"+"{:10d}".format(x));
print("Center aligned (width 10) :"+"{:^10d}".format(x));
print()

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now