title: Type error: Can only join an iterable Python-error
body: <p>First off, I have already looked at these posts on the same topic:</p>
  
  <p><a href="https://stackoverflow.com/questions/40699726/typeerror-can-only-join-an-iterable-python">TypeError: can only join an iterable python</a></p>
  
  <p><a href="https://stackoverflow.com/questions/32144173/can-only-join-an-iterable-python-error">&quot;Can only join an iterable&quot; python error</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19821026/can-only-iterable-python-error">&quot;Can only iterable&quot; Python error</a></p>
  
  <p><a href="https://stackoverflow.com/questions/40354027/python-error-can-only-join-an-iterable">python error-can only join an iterable</a></p>
  
  <p>But sadly, none of them seem to answer my problem. I want to take a list, and sort all of the non -1 values by size, then return the -1's to their original spot. Here is my code:</p>
  
  <pre><code>def sortByHeight(a):
      treeLocations = []
      for everyHeight in a:
          if everyHeight == -1:
              treeLocations.append([(len(a)-a.index(everyHeight)), (a.index(everyHeight)-1)])
              a.remove(-1)
      people = sorted(a)
      for everyPair in treeLocations:
          one = everyPair[1]
          two = everyPair[0]
          people[one:two] = -1
      return(people)
  
  sortByHeight([-1, 150, 190, 170, -1, -1, 160, 180])
  </code></pre>
  
  <p>My code throws the error: TypeError: can only assign an iterable, on line 11.
  What does this mean, and how can I fix it?</p>