Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
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

error: Content is protected !!