title: "Can only join an iterable" python error
body: <p>I've already looked at this post about iterable python errors:</p>
  
  <p><a href="https://stackoverflow.com/questions/19821026/can-only-iterable-python-error">&quot;Can only iterable&quot; Python error</a></p>
  
  <p>But that was about the error "cannot assign an iterable". My question is why is python telling me:</p>
  
  <pre><code> "list.py", line 6, in &lt;module&gt;
      reversedlist = ' '.join(toberlist1)
  TypeError: can only join an iterable
  </code></pre>
  
  <p>I don't know what I am doing wrong! I was following this thread:</p>
  
  <p><a href="https://stackoverflow.com/questions/10745593/reverse-word-order-of-a-string-with-no-str-split-allowed">Reverse word order of a string with no str.split() allowed</a></p>
  
  <p>and specifically this answer:</p>
  
  <pre><code>&gt;&gt;&gt; s = 'This is a string to try'
  &gt;&gt;&gt; r = s.split(' ')
  ['This', 'is', 'a', 'string', 'to', 'try']
  &gt;&gt;&gt; r.reverse()
  &gt;&gt;&gt; r
  ['try', 'to', 'string', 'a', 'is', 'This']
  &gt;&gt;&gt; result = ' '.join(r)
  &gt;&gt;&gt; result
  'try to string a is This'
  </code></pre>
  
  <p>and adapter the code to make it have an input. But when I ran it, it said the error above. I am a complete novice so could you please tell me what the error message means and how to fix it.</p>
  
  <p>Code Below:</p>
  
  <pre><code>import re
  list1 = input ("please enter the list you want to print")
  print ("Your List: ", list1)
  splitlist1 = list1.split(' ')
  tobereversedlist1 = splitlist1.reverse()
  reversedlist = ' '.join(tobereversedlist1)
  yesno = input ("Press 1 for original list or 2 for reversed list")
  yesnoraw = int(yesno)
  if yesnoraw == 1:
      print (list1)
  else:
      print (reversedlist)
  </code></pre>
  
  <p>The program should take an input like apples and pears and then produce an output pears and apples.</p>
  
  <p>Help would be appreciated!</p>