title: Python: .send function of socket programming
body: <p>I send some message 'hello' from client to server using this command on server</p>
  
  <pre><code>    #Send some data to remote server
      message = 'hello'
  
      try :
  
      s.send(message)
      print 'data sent successfully'
      except socket.error:
      #Send failed
      print 'Send failed'
  </code></pre>
  
  <p>Now on server side , I want to check whether this message is present as a key in dictionary which is created on server side.</p>
  
  <pre><code>    msg=c.recvfrom(1024)
  
       if msg in data2.keys():
   print("key for this msg exists", msg)
       else:
       print("no such key exists",msg)
  </code></pre>
  
  <p>Now, the problem is it always says no such key exits. When I print the msg on server side which I have got from client.It comes out to be:</p>
  
  <pre><code>   ('hello', None)
  </code></pre>
  
  <p>I don't get it why it gives None along with hello.</p>
  
  <p>because of this I am not even getting a match in dictionary. Please tell me where I am doing wrong.</p>