1# Only leading whitespaces are removed
2text1 = ' Python Programming '
3print(text1.lstrip())
4
5
6# Remove the whitespace and specified character at
7# leading end
8text2 = ' code its my code '
9print(text2.lstrip(' code'))
10
11# Remove the specified character at
12# leading end
13text3 = 'code its my code'
14print(text3.lstrip('code'))
1Remove spaces to the left of the string:
2
3txt = " banana "
4
5x = txt.lstrip()
6
7print("of all fruits", x, "is my favorite")