padding in python

Solutions on MaxInterview for padding in python by the best coders in the world

showing results for - "padding in python"
Kelya
25 Oct 2020
1MyString = "ABC"
2print("'" + MyString.ljust(5) + "'")  #Left Justified
3print("'" + MyString.rjust(5) + "'")  #Right Justified
4
5
6Output:
7'ABC  '
8'  ABC'
9