python left padding code example
Example 1: padding in python
MyString = "ABC"
print("'" + MyString.ljust(5) + "'") #Left Justified
print("'" + MyString.rjust(5) + "'") #Right Justified
Output:
'ABC '
' ABC'
Example 2: python pad left
numStr = "5"
numStr = numStr.zfill(4)