About Lesson
lstrip():-
The lstrip() method removes any leading characters (space is the default leading character to remove)
Syntax:- string.lstrip(characters)
txt = ” banana “ x = txt.lstrip() print(“of all fruits”, x, “is my favorite”) Output of all fruits banana is my favorite |
txt = “,,,,,ssaaww…..banana” x = txt.lstrip(“,.asw”) print(x) Output banana |