title: Is it possible to delete the last byte of a bytes in python?
body: <p>For some reason, I have to remove the last byte of a bytes. For example,</p>
  
  <pre><code>teststr = b'\x01\x02\x03'
  </code></pre>
  
  <p>In my case, I have to remove the last byte \x03. I know the strip can do in the python string case, but it doesn't work in the bytes case.</p>
  
  <p>Is there a way to do this? Any information is appreciated.</p>