Consider the following code...
base64EncodedCredentials = base64.b64encode(b"johndoe:mysecret")
print(base64EncodedCredentials)
the response I get back is
b'am9obmRvZTpteXNlY3JldA=='
Why does it have a b before the string? How can I get just the string value of 'am9obmRvZTpteXNlY3JldA==' instead?
Technically speaking - this question can be considered a duplicate of another question IF you know that the problem is about byte string vs. string. In my case, I asked the question because I did not know that there was something called byte string. For new Python programmers, this question may be beneficial because it uses language they see on their program or debugger. If they don't know what a byte string is, perhaps this question can be useful and provide the translation from their problem to the technical terms used by more fluent Python programmers. The question differs in use of vocabulary.