How is lstrip() method removing chars from left? [duplicate]

  python, python-3.x, string, strip

My understanding is that the lstrip(arg) removes characters from the left based on the value of arg.

I am executing the following code:

'htp://www.abc.com'.lstrip('/')

Output:

'htp://www.abc.com'

My understanding is that all the characters should be stripped from left until / is reached.
In other words, the output should be:

'www.abc.com'

I am also not sure why running the following code is generating below output:

'htp://www.abc.com'.lstrip('/:pth')

Output:

'www.abc.com'

Source: Python Questions

LEAVE A COMMENT