title: a bytes-like object is required, not 'str'
body: <pre><code>import socket
  
  IP = "127.0.0.1"
  PORT = 5200
  
  # Create a TCP/IP socket
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  
  # Connecting to remote computer 80
  server_address = (IP,PORT)
  sock.connect(server_address)
  # Sending data to server
  
  
  x = input('enter firstname:')
  sock.send(x)
  y = input("enter lastname:")
  sock.send(y)
  
  server_msg = sock.recv(1024)
  print (server_msg)
  
  
  # Closing the socket
  sock.close()
  </code></pre>
  
  <p>when I run the code it I get this error " a bytes-like object is required, not 'str' " ,any idea how to solve it?
  and i get this error when i'm typing the first name.</p>