title: can only concatenate str (not "bytes") to str
body: <pre><code>import socket
  import os
  
  user_url = input("Enter url: ")
  
  host_name = user_url.split("/")[2]
  mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  mysock.connect((host_name, 80))
  cmd = 'GET ' + user_url + ' HTTP/1.0\r\n\r\n'.encode()
  mysock.send(cmd)
  
  while True:
      data = mysock.recv(512)
      if len(data) &lt; 1:
          break
       print(data.decode(),end='\n')
  
  mysock.close()
  </code></pre>
  
  <p>For some reason im gettin this error</p>
  
  <blockquote>
    <h2>Enter url: <a href="http://data.pr4e.org/romeo.txt" rel="noreferrer">http://data.pr4e.org/romeo.txt</a></h2>
  
  <pre><code> 7 mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   8 mysock.connect((host_name, 80))
   9 cmd = 'GET ' + user_url + ' HTTP/1.0\r\n\r\n'.encode()
   TypeError: can only concatenate str (not "bytes") to str
  </code></pre>
  </blockquote>
  
  <p>Any ideas what im doing wrong with it?Encoding and decoding seems right to me, and i've trasnfered it using \n before .encode().
  This is for a class</p>