Python Forum

Full Version: why does this happen?can it be bug?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
>>> print(b"any text")

we have given an input in this way;

output >>> b'any text'


I got SynTaxError when I tried the letter "b" in other letters.
Do you know what the "b" is for? There are a few string prefixes that denote different kinds of string literal. See the docs for what they are.

So no, I don't see a bug there. Also, don't you think if there was an obvious bug like that, it would have been spotted by now?