- ljust() is a python in-build function which operate on the string to shift in the left portion and add some new character
- here length is the length of required string
- and fillchar is only one character long.
string is s="mytext"
and we apply s.ljust(10,'1'), then it will become 'mytext1111' of length 10, and old string is shift at left.
print("Enter character to add")
print("Enter length of required string")
print("original string is ",s)
print("String after ljust ",s)
print("String length become ",len(s))
Enter character to add
Enter length of required string
original string is mytext
String after ljust mytext1111
String length become 10
-In this program, we take a input of string and substring to add and input of required length, then with the use of ljust()
function we shift the given string at left side.