strip() works selectively on the input function but properly on a string literal
<p>I am trying to understand the <code>strip()</code> function. And I'm seeing a confusing behavior.</p>

<pre><code>import sys
test = input().strip('e')
print(test)

N = input().strip('cmowz.')
print(N)

print('www.example.com'.strip('cmowz.'))
</code></pre>

<p>This gives the following output:</p>

<pre><code>test   message  here   
'www.example.com'
example
</code></pre>

<p>So what I'm seeing is that calling <code>input().strip()</code> method works properly for trailing and leading spaces. But it doesn't work for anything else.</p>

<p><code>input().strip('e')</code> doesn't really strip e from the string.</p>

<p>However, calling a string literal <code>"somethinghere".strip('e')</code> works fine.</p>

<p>Can someone please explain this inconsistent behavior?</p>

<p>From the <a href="https://docs.python.org/2/library/string.html#string.strip" rel="nofollow">documentation</a>:</p>

<blockquote>
  <p>Return a copy of the string with <code>leading</code> and <code>trailing</code> characters removed. If chars is omitted or None, whitespace characters are removed. If given and not None, chars must be a string; the characters in the string will be stripped from the both ends of the string this method is called on.</p>
</blockquote>

<p>This is working exactly as expected. </p>

python python-3.x strip