title: Code outputs right information but the formatting is incorrect, How do you segment a string?
body: <p>This is my code:</p>
  
  <pre><code>def string2bin(s):
  y = []
  for x in s:
      q = []
      q.append(str(bin(ord(x))[2:].zfill(8)))
      y.append(q)
  return y
  </code></pre>
  
  <p>It is supposed to output:</p>
  
  <pre><code>string2bin('abc')
  [[0, 1, 1, 0, 0, 0, 0, 1], [0, 1, 1, 0, 0, 0, 1, 0],
   [0, 1, 1, 0, 0, 0, 1, 1]]
  </code></pre>
  
  <p>But instead outputs:</p>
  
  <pre><code>string2bin('abc')
  [['01100001'], ['01100010'], ['01100011']]
  </code></pre>
  
  <p>Also how do you segment a string?
  Thanks for any help!</p>