sys.stdin.readline() with if else (Python)
<p>I am new at Python and need a little help. 
I am trying to use the next command in order to get user input from screen:
sys.stdin.readline()</p>

<p>All is fine when I want to print something but when I am trying to combine an if else statement it seems that the user input is ignoring the case sensitive string that I wrote in the if == and it always return the else even when I writing the input 'Sam'</p>

<p>I want to make a simple task like this one:</p>

<pre><code>print("What is your name ?")

name = sys.stdin.readline()

print("Hello", name)

if name == 'Sam' :
    print ('You are in our group')
else :
    print('You are not in our group')
</code></pre>

<p>What should I do in the sys.stdin.readline() will acknowledge the if == argument ?</p>

<p>Thank you for you Help</p>

<p>The line will include the end of line character <code>'\n'</code> (<a href="https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects" rel="nofollow">docs</a>). So it's never equal to <code>'Sam'</code> (except possibly at the end of the file).</p>

<p>Maybe use <code>name = name.strip()</code> to remove it and any extra whitespace characters.</p>

python