title: Converting a string to and from Base 64
body: <p>I am trying to write two programs one that converts a string to base64 and then another that takes a base64 encoded string and converts it back to a string.<br>
  so far i cant get past the base64 encoding part as i keep getting the error</p>
  
  <pre><code>TypeError: expected bytes, not str
  </code></pre>
  
  <p>my code looks like this so far</p>
  
  <pre><code>def convertToBase64(stringToBeEncoded):
  import base64
  EncodedString= base64.b64encode(stringToBeEncoded)
  return(EncodedString)
  </code></pre>